Github user wenlong88 commented on the issue: https://github.com/apache/flink/pull/3595 @greghogan Thanks for the review. I have add non-negative check and update the test with ExpectedException. But I don't think we need to call toString in the test since we have check the position instead I add a test to verify that toString returns the substring with range(0, position) to meet your concern. One update about setPosition in outputStream, I think it is better to auto extend the buffer when setting a position larger than the buffer size, just like the auto extending in write.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---