Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InputStream inputStream = socket.getInputStream();
- // read from the stream
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] content = new byte[ 2048 ];
- int bytesRead = -1;
- while( ( bytesRead = inputStream.read( content ) ) != -1 ) {
- baos.write( content, 0, bytesRead );
- } // while
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement