I am facing a problem, trying to read the data from a url. I open a connection and get an input stream of the url. When I read the input stream into a byte, only part of the data is read, other characters become junk.
This is the code I use
URL url = new URL(uri);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
byte file = new byte[conn.getContentLength()];
int size = in.read( file, 0, conn.getContentLength() );
The size (no of bytes read) is way less than the length of the stream. Please help...