static byte[] readBytes(InputStream is,byte[] ioBuffer,int maxSize) throws IOException {
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  copyBytes(baos,is,ioBuffer,maxSize);
  return baos.toByteArray();
}

static byte [ ] readBytes ( InputStream is , byte [ ] ioBuffer , int maxSize ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; copyBytes ( baos , is , ioBuffer , maxSize ) ; return baos . toByteArray ( ) ; }
reads all the bytes ( but no more that maxsize ) from given input stream through iobuffer and returns byte array containing all the read bytes .
