code: public void readFully(byte[] buffer, int offset, int length) throws IOException {
  		while (length > 0) {
  			int amountRead = checkedRead(buffer, offset, length);
  			offset += amountRead;
  			length -= amountRead;
  		}
  	}
docs: Repeatedly read the underlying {@link InputStream} until the requested number of
  bytes have been loaded.
  @param buffer the destination buffer
  @param offset the buffer offset
  @param length the amount of data to read
  @throws IOException in case of I/O errors