[ https://issues.apache.org/jira/browse/FLINK-6162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15951957#comment-15951957 ]
ASF GitHub Bot commented on FLINK-6162: --------------------------------------- Github user wenlong88 commented on the issue: https://github.com/apache/flink/pull/3595 @greghogan I come across this bug when we are trying to write some objects to a byte array: at first, I wrote a 0 as initial size and then the serialized object, after that, I seek back to the start position to correct the size and then seek to the end of the written data to continue to write other object. When the array can auto expanding, I can just reserve some hole at first and then seek back and fill the hole. > Fix bug in ByteArrayOutputStreamWithPos#setPosition > --------------------------------------------------- > > Key: FLINK-6162 > URL: https://issues.apache.org/jira/browse/FLINK-6162 > Project: Flink > Issue Type: Bug > Components: Core > Reporter: Wenlong Lyu > Assignee: Wenlong Lyu > > Currently the precondition check in setPosition will fail when the buffer is > full: > {{Preconditions.checkArgument(position < getEndPosition(), "Position out of > bounds.");}} > We should allow the expected position to be the end position -- This message was sent by Atlassian JIRA (v6.3.15#6346)