Skip to content

Commit 9c3aae3

Browse files
Edarkevbabanin
andauthored
Update bson/src/main/org/bson/io/BasicOutputBuffer.java
Co-authored-by: Viacheslav Babanin <frest0512@gmail.com>
1 parent 0ca525d commit 9c3aae3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bson/src/main/org/bson/io/BasicOutputBuffer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private void checkPosition(final int absolutePosition, final int bytesToWrite) {
209209
throw new IllegalArgumentException(format("position must be >= 0 but was %d", absolutePosition));
210210
}
211211
if (absolutePosition > buffer.position() - bytesToWrite) {
212-
throw new IllegalArgumentException(format("position must be <= %d but was %d", buffer.position() - 1, absolutePosition));
212+
throw new IllegalArgumentException(format("position must be <= %d but was %d", buffer.position() - bytesToWrite, absolutePosition));
213213
}
214214
}
215215
}

0 commit comments

Comments
 (0)