private void doReadTest(InputStream stream, byte[] src, int sizeToProvide) throws Exception {
    InputStreamReadableStreamChannel channel;
    if (sizeToProvide >= 0) {
      channel = new InputStreamReadableStreamChannel(stream, sizeToProvide, EXECUTOR_SERVICE);
      assertEquals("Reported size of channel incorrect", sizeToProvide, channel.getSize());
    } else {
      channel = new InputStreamReadableStreamChannel(stream, EXECUTOR_SERVICE);
      assertEquals("Reported size of channel incorrect", -1, channel.getSize());
    }
    assertTrue("Channel should be open", channel.isOpen());
    RetainingAsyncWritableChannel writableChannel = new RetainingAsyncWritableChannel(src.length);
    ReadIntoCallback callback = new ReadIntoCallback();
    long bytesRead = channel.readInto(writableChannel, callback).get(1, TimeUnit.SECONDS);
    callback.awaitCallback();
    if (callback.exception != null) {
      throw callback.exception;
    }
    assertEquals("Total bytes written does not match (callback)", src.length, callback.bytesRead);
    assertEquals("Total bytes written does not match (future)", src.length, bytesRead);
    try (InputStream is = writableChannel.consumeContentAsInputStream()) {
      assertArrayEquals("Data does not match", src,
          Utils.readBytesFromStream(is, (int) writableChannel.getBytesWritten()));
    }
    channel.close();
    assertFalse("Channel should be closed", channel.isOpen());
    writableChannel.close();
  }
Does the test for reading from a {@link InputStreamReadableStreamChannel} that wraps the provided {@code stream}.
Ensures that the data used to construct the {@code stream} ({@code src}) matches the data that is read from the
created {@link InputStreamReadableStreamChannel}.
@param stream the {@link InputStream} to use.
@param src the data that was used to construct {@code stream}.
@param sizeToProvide the size to provide to the constructor of {@link InputStreamReadableStreamChannel}.
@throws Exception
ambry-commons/src/test/java/com/github/ambry/commons/InputStreamReadableStreamChannelTest.java