Package org.conscrypt
Class BufferUtils
java.lang.Object
org.conscrypt.BufferUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
checkNotNull
(ByteBuffer[] buffers) ThrowsIllegalArgumentException
if any of the buffers in the array are null.(package private) static void
consume
(ByteBuffer[] sourceBuffers, int toConsume) MarkstoConsume
bytes of data as consumed from the buffer array.(package private) static ByteBuffer
copyNoConsume
(ByteBuffer[] buffers, ByteBuffer destination, int maxAmount) Copies up tomaxAmount
bytes from a buffer array todestination
.(package private) static ByteBuffer
getBufferLargerThan
(ByteBuffer[] buffers, int minSize) Looks for a buffer in the buffer array which EITHER is larger thanminSize
AND has no preceding non-empty buffers OR is the only non-empty buffer in the array.(package private) static long
remaining
(ByteBuffer[] buffers) Returns the total number of bytes remaining in the buffer array.
-
Constructor Details
-
BufferUtils
private BufferUtils()
-
-
Method Details
-
checkNotNull
ThrowsIllegalArgumentException
if any of the buffers in the array are null. -
remaining
Returns the total number of bytes remaining in the buffer array. -
consume
MarkstoConsume
bytes of data as consumed from the buffer array.- Throws:
IllegalArgumentException
- if there are fewer thantoConsume
bytes remaining
-
getBufferLargerThan
Looks for a buffer in the buffer array which EITHER is larger thanminSize
AND has no preceding non-empty buffers OR is the only non-empty buffer in the array. -
copyNoConsume
Copies up tomaxAmount
bytes from a buffer array todestination
. The copied data is not marked as consumed from the source buffers, on the assumption the copy will be passed to some method which will consume between 0 andmaxAmount
bytes which can then be reflected in the source array using theconsume()
method.
-