You need to use InputStream. Readers are for character data. Look at transferring a data stream using a DataInputStream, for example:
stream=new DataInputStream(new BufferedInputStream(new FileInputStream(...)));
The data input stream will give you many useful methods for reading various types of data and, of course, the basic InputStream methods for reading bytes.
(This is really what an HTTP server needs to do to read a request with content.)
readUTF does not read a line, it reads a line that was written in the (modified) UTF8 format - refer to JavaDoc.
Lawrence dol
source share