@Test
public void readToBufferWithArrayOffsetSucceeds() throws Exception {

  GoogleCloudStorageReadOptions options =
      GoogleCloudStorageReadOptions.builder().setGrpcChecksumsEnabled(true).build();
  GoogleCloudStorageGrpcReadChannel readChannel = newReadChannel(options);
  byte[] array = new byte[OBJECT_SIZE + 100];
  // `ByteBuffer.slice` generates a ByteBuffer with a non-zero `arrayOffset`.
  ByteBuffer buffer = ByteBuffer.wrap(array, 50, OBJECT_SIZE).slice();
  readChannel.read(buffer);
  byte[] expected = ByteString.copyFrom(array, 50, OBJECT_SIZE).toByteArray();
  assertArrayEquals(fakeService.data.toByteArray(), expected);
}