code: private byte nextByte(ByteBuffer inputBuffer) throws IOException {
          getAtLeastBytes(inputBuffer, 1, ReadMode.ONLY_WHEN_EMPTY);
          return inputBuffer.get();
      }
docs: Reads the next available byte from the input buffer provided, waiting if data is not
  available.
  @param inputBuffer the buffer to read from
  @return one byte of data from the stream
  @throws IOException if there are problems reading data.