Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #468 #570

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixes #468 #570

wants to merge 1 commit into from

Conversation

indianwhocodes
Copy link
Contributor

Looking at our implementation of MantaSeekableByteChannel.read(ByteBuffer) it appears that we don't follow the API contract:

Interface documentation:

    /**
     * Reads a sequence of bytes from this channel into the given buffer.
     *
     * <p> Bytes are read starting at this channel's current position, and
     * then the position is updated with the number of bytes actually read.
     * Otherwise this method behaves exactly as specified in the {@link
     * ReadableByteChannel} interface.
     */

This method is not reading data into the supplied byte buffer at all. In the Java source code, many of the implementations that implement this method use the static method IOUtil.read. Within that implementation you can see that data is clearly being read into the ByteBuffer. Whereas in the MantaSeekableByteChannel implementation no data is being read into the ByteBuffer.

Elijah's Feedback
Copy link

@kellymclaughlin kellymclaughlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the CI test failures and they look potentially related to this change.

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017, Joyent, Inc. All rights reserved.
* Copyright (c) 2016-2019, Joyent, Inc. All rights reserved.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants