protected int read(InputStream inputStream,byte[] buffer,int offset,int length) throws IOException {
  int readLength=inputStream.read(buffer,offset,length);
  if (readLength != length) {
    throw new IOException("wrong byte length");
  }
  return readLength;
}

protected int read ( InputStream inputStream , byte [ ] buffer , int offset , int length ) throws IOException { int readLength = inputStream . read ( buffer , offset , length ) ; if ( readLength != length ) { throw new IOException ( "wrong byte length" ) ; } return readLength ; }
reads a number ( specified by length ) of bytes from a given file reader into a byte array beginning at the given offset .
