@@ -1025,13 +1025,17 @@ public MessagePacker writePayload(byte[] src, int off, int len)
1025
1025
/**
1026
1026
* Writes a byte array to the output.
1027
1027
* <p>
1028
- * Unlike {@link #writePayload(byte[])} method, this method doesn't copy the byte array even when given byte
1029
- * array is shorter than {@link MessagePack.PackerConfig#withBufferFlushThreshold(int)}. This is faster than
1030
- * {@link #writePayload(byte[])} method but caller must not modify the byte array after calling this method.
1028
+ * This method is used with {@link #packRawStringHeader(int)} or {@link #packBinaryHeader(int)} methods.
1029
+ * <p>
1030
+ * Unlike {@link #writePayload(byte[])} method, this method does not make a defensive copy of the given byte
1031
+ * array, even if it is shorter than {@link MessagePack.PackerConfig#withBufferFlushThreshold(int)}. This is
1032
+ * faster than {@link #writePayload(byte[])} method but caller must not modify the byte array after calling
1033
+ * this method.
1031
1034
*
1032
1035
* @param src the data to add
1033
1036
* @return this
1034
1037
* @throws IOException when underlying output throws IOException
1038
+ * @see #writePayload(byte[])
1035
1039
*/
1036
1040
public MessagePacker addPayload (byte [] src )
1037
1041
throws IOException
@@ -1042,16 +1046,19 @@ public MessagePacker addPayload(byte[] src)
1042
1046
/**
1043
1047
* Writes a byte array to the output.
1044
1048
* <p>
1045
- * Unlike {@link #writePayload(byte[], int, int)} method, this method doesn't copy the byte array even when
1046
- * given byte array is shorter than {@link MessagePack.PackerConfig#withBufferFlushThreshold(int)}.
1047
- * This is faster than {@link #writePayload(byte[], int, int)} method but caller must not modify the byte array
1048
- * after calling this method.
1049
+ * This method is used with {@link #packRawStringHeader(int)} or {@link #packBinaryHeader(int)} methods.
1050
+ * <p>
1051
+ * Unlike {@link #writePayload(byte[], int, int)} method, this method does not make a defensive copy of the
1052
+ * given byte array, even if it is shorter than {@link MessagePack.PackerConfig#withBufferFlushThreshold(int)}.
1053
+ * This is faster than {@link #writePayload(byte[])} method but caller must not modify the byte array after
1054
+ * calling this method.
1049
1055
*
1050
1056
* @param src the data to add
1051
1057
* @param off the start offset in the data
1052
1058
* @param len the number of bytes to add
1053
1059
* @return this
1054
1060
* @throws IOException when underlying output throws IOException
1061
+ * @see #writePayload(byte[], int, int)
1055
1062
*/
1056
1063
public MessagePacker addPayload (byte [] src , int off , int len )
1057
1064
throws IOException
0 commit comments