code: @Override
      public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException {
          Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount);
          if (byteCount == 0) {
              return 0;
          }
          checkReadPrimitiveTypes();
          return primitiveData.read(buffer, byteOffset, byteCount);
      }
docs: Reads at most {@code length} bytes from the source stream and stores them
  in byte array {@code buffer} starting at offset {@code count}. Blocks
  until {@code count} bytes have been read, the end of the source stream is
  detected or an exception is thrown.
  
  @param buffer
  the array in which to store the bytes read.
  @param byteOffset
  the initial position in {@code buffer} to store the bytes
  read from the source stream.
  @param byteCount
  the maximum number of bytes to store in {@code buffer}.
  @return the number of bytes read or -1 if the end of the source input
  stream has been reached.
  @throws IndexOutOfBoundsException
  if {@code offset < 0} or {@code length < 0}, or if
  {@code offset + length} is greater than the length of
  {@code buffer}.
  @throws IOException
  if an error occurs while reading from this stream.
  @throws NullPointerException
  if {@code buffer} is {@code null}.