Package org.jdrupes.httpcodec.util
Class ByteBufferUtils
java.lang.Object
org.jdrupes.httpcodec.util.ByteBufferUtils
Utilities for handling
ByteBuffer
s-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
putAsMuchAsPossible
(ByteBuffer dest, ByteBuffer src) Put as many bytes as possible from the src buffer into the destination buffer.static boolean
putAsMuchAsPossible
(ByteBuffer dest, ByteBuffer src, int limit) Put as many bytes as possible from the src buffer into the destination buffer but not more than specified by limit.
-
Method Details
-
putAsMuchAsPossible
Put as many bytes as possible from the src buffer into the destination buffer.- Parameters:
dest
- the destination buffersrc
- the source buffer- Returns:
- true if src.remaining() == 0
-
putAsMuchAsPossible
Put as many bytes as possible from the src buffer into the destination buffer but not more than specified by limit.- Parameters:
dest
- the destination buffersrc
- the source bufferlimit
- the maximum number of bytes to transfer- Returns:
- true if src.remaining() == 0
-