Class ByteBufferUtils
java.lang.Object
org.apache.tomcat.util.buf.ByteBufferUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Clean specified direct buffer.static ByteBuffer
expand
(ByteBuffer in, int newSize) Expands buffer to the given size unless it is already as big or bigger.
-
Method Details
-
expand
Expands buffer to the given size unless it is already as big or bigger. Buffers are assumed to be in 'write to' mode since there would be no need to expand a buffer while it was in 'read from' mode.- Parameters:
in
- Buffer to expandnewSize
- The size t which the buffer should be expanded- Returns:
- The expanded buffer with any data from the input buffer copied in to it or the original buffer if there was no need for expansion
-
cleanDirectBuffer
Clean specified direct buffer. This will cause an unavoidable warning on Java 24 and newer.- Parameters:
buf
- the buffer to clean
-