public class ByteBufferUtils extends Object
expandExpands 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.
in- Buffer to expand
newSize- The size t which the buffer should be expanded
- 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
cleanDirectBufferpublic static void cleanDirectBuffer