public byte[] read() throws IOException {
  ByteArrayOutputStream bout=new ByteArrayOutputStream();
  int b=0;
  while ((b=in.read()) >= 0) {
    bout.write(b);
  }
  return bout.toByteArray();
}

public byte [ ] read ( ) throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; int b = 0 ; while ( ( b = in . read ( ) ) >= 0 ) { bout . write ( b ) ; } return bout . toByteArray ( ) ; }
read all remaining bytes from the stream
