Top Fields Constructors Methods
org.apache.tomcat.util.buf

public Class ByteBufferUtils

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, .InvocationTargetException, .Method, java.nio.ByteBuffer, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.res.StringManager

Field Summary

Modifier and TypeField and Description
private static final Method
private static final Method
private static final Method
private static final Log
private static final StringManager
private static final Object

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
public static ByteBuffer

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
expand
(ByteBuffer
Buffer to expand
in
,
int
The size t which the buffer should be expanded
newSize
)

Expands buffer to the given size unless it is already as big or bigger.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cleanerMethodback to summary
private static final Method cleanerMethod
cleanMethodback to summary
private static final Method cleanMethod
invokeCleanerMethodback to summary
private static final Method invokeCleanerMethod
logback to summary
private static final Log log
smback to summary
private static final StringManager sm
unsafeback to summary
private static final Object unsafe

Constructor Detail

ByteBufferUtilsback to summary
private ByteBufferUtils()

Method Detail

cleanDirectBufferback to summary
public static void cleanDirectBuffer(ByteBuffer buf)
expandback to summary
public static ByteBuffer expand(ByteBuffer in, int newSize)

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:ByteBuffer

Buffer to expand

newSize:int

The size t which the buffer should be expanded

Returns:ByteBuffer

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