public Optional<DataChunk> nextChunk() throws IOException {
    byte[] chunkOfData = inputStream.readNBytes(chunkSizeBytes);
    Optional<DataChunk> resp =
        chunkOfData.length == 0
            ? Optional.empty()
            : Optional.of(
                DataChunk.builder()
                    .setChunk(chunkOfData)
                    .setStreamByteOffset(streamByteOffset)
                    .build());
    streamByteOffset += chunkOfData.length;
    return resp;
  }
Constructs a new DataChunk from just {@code chunkSizeBytes} bytes of the stream.

<p>Returned chunk will be less than or equal to chunkSizeBytes, or absent if no bytes were
remaining in the stream.
extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/StreamChunker.java