Hello :)
I need a little help. Im trying to get binary data from InputStream in
my servlet. But there is a little problemm. When i send values like
0x01 ... 0x9F - everything semes to be ok but sending
0xA0 ... 0xFF - gives me values like 31-63
Here is me servlet code
---------------------------------------
int t = request.getInputStream().read(); <-- i think here is
something wrong but why ?
res.getOutputStream().write("Got : "+t);
---------------------------------------
Ill be happy if someone can help me :)
Thanks.
panklata@gmail.com - 28 Nov 2007 15:42 GMT
Ok got it ;] I was sending data in my test client, using
OutputStringWriter instead of simple OutputStream.
:)
Roedy Green - 29 Nov 2007 01:34 GMT
>int t = request.getInputStream().read();
you probably want a DataInputStream or a LEDataInputStream if you want
binary. read just gets you bytes without any clumping into
primitives.
see http://mindprod.com/applet/fileio.html
for sample code.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com