469,950 Members | 2,372 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Httprequest.inputstream from mobile

i am using mobile for communication with live server
when mobile send its information to server the input stream is encoded in utf-8
that is converted into string but it is still not understandable
so chk it what should i do to convert such type of data


Stream str;
string strmContents= "";
int counter, strLen, strRead;

// Create a Stream object.
str = context.Request.InputStream;
_request.WriteLine("Stream direct input stream:" + str.ToString());
// Find number of bytes in stream.
strLen = (int)str.Length;
// Create a byte array.
byte[] strArr = new byte[strLen];
// Read stream into byte array.
strRead = str.Read(strArr,0,strLen);
//_request.WriteLine("Stream byte data:" + strArr.ToString());
/*// Convert byte array to a text string.
for(counter = 0;counter<strLen-1;counter++)
strmContents = strmContents + strArr[counter].ToString();

_request.WriteLine("InputStream:" + strmContents+"\ninoutstream length:"+Convert.ToString(strLen));


Result: i got a string
InputStream:20010629454747838978677776474768846832 83121110997776324946494747697810910811334946490111 43831211109977764749464901101349495553495455555557 01913490111087310411611611258474750485046565146495 45746494953471021051109710847115121110994710010110 29711710811646115121110991091080111038735153505349 50484957535454554848018631149710410110110801178900 17139854520183311512111099109108589711711610445989 71151059901100793991097011190878611579109494997717 01169887701070119001763515148480111001077075349017 93504849018411087397100100981111111070111038739710 01009811111110701190016974301793490111110070753500 17935048490184110873999710810111010097114011103873 99971081011101009711401190016974301793490111110095 75351019001713119981201091080183397112112108105999 71161051111104711811010046115121110991091084510010 11181051101024311998120109108011008410387346471001 01118105110102494901179195134632001062945474783897 86777764747688468326810111873110102324946494747697 87410134946490181377111116111114111108973267694432 67111112121114105103104116325048484801853765401943 82515349499571954865465351464965820180365658571504 85649656701733515350534950484957535454554848017531 12104111110101017193397100100981111111070190703116 10112011647120451189997114100011003504649011987031 16101120116471204511899971141000110035046490119596 34901963500111719339997108101110100971140190703116 10112011647120451189997108101110100971140110034946 48011987031161011201164712045118999710810111010097 11401100349464801195963490196350011169703116101120 11647120451189997114100018836669717378019938667658 26801883697868019938667658268018838669828373797801 99350464901883707801883780188384697601873808269700 18738779827501873727977690187367697676018738673686 97901873706588018738065716982018738845777984458273 78717368018836668658901883656882018736879770187372 79776901873877982750187373788476018738079838465760 18738065826769760188369776573760187373788469827869 84018838845777984456765840188388457779844577760188 36772658283698401703116101120116471204511899971081 01110100971140188366697173780199386676576697868658 20199386698669788401883666971737801993866765766978 68658201993866986697884018838669828373797801993494 64801883666971737801883697868018838385777765828901 88368848384658284018836884697868018836565766582770 18838282857669018836988686584690188367658469717982 73698301883808273798273848901883688569018836779778 07669846968018838384658485830188367726582836984011 1111181
inoutstream length:1274
Mar 30 '07 #1
0 1061

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by HikksNotAtHome | last post: by
4 posts views Thread by Daniel Rimmelzwaan | last post: by
1 post views Thread by Matt | last post: by
1 post views Thread by samtilden | last post: by
1 post views Thread by Jeff | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.