Skip to content

Commit 4976b7f

Browse files
authored
#542: Add a warning note for the usage of MessageUnpacker.readPayloadAsReference (#546)
1 parent a7bcbec commit 4976b7f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java

+3
Original file line numberDiff line numberDiff line change
@@ -1616,6 +1616,9 @@ public void readPayload(byte[] dst, int off, int len)
16161616
/**
16171617
* Reads payload bytes of binary, extension, or raw string types as a reference to internal buffer.
16181618
*
1619+
* Note: This methods may return raw memory region, access to which has no strict boundary checks.
1620+
* To use this method safely, you need to understand the internal buffer handling of msgpack-java.
1621+
*
16191622
* <p>
16201623
* This consumes specified amount of bytes and returns its reference or copy. This method tries to
16211624
* return reference as much as possible because it is faster. However, it may copy data to a newly

0 commit comments

Comments
 (0)