Package org.glassfish.grizzly.memory
Interface WrapperAware
-
- All Known Implementing Classes:
ByteBufferManager,HeapMemoryManager,PooledMemoryManager
public interface WrapperAwareMemoryManagers, which implement this interface, are able to convert frequently used Java buffer types to GrizzlyBuffer.- Author:
- Alexey Stashok
- See Also:
MemoryUtils,MemoryManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Bufferwrap(byte[] data)ReturnsBuffer, which wraps the byte array.Bufferwrap(byte[] data, int offset, int length)ReturnsBuffer, which wraps the part of byte array with specific offset and length.Bufferwrap(java.lang.String s)ReturnsBuffer, which wraps theString.Bufferwrap(java.lang.String s, java.nio.charset.Charset charset)Bufferwrap(java.nio.ByteBuffer byteBuffer)ReturnsBuffer, which wraps theByteBuffer.
-
-
-
Method Detail
-
wrap
Buffer wrap(byte[] data)
ReturnsBuffer, which wraps the byte array.- Parameters:
data- byte array to wrap- Returns:
Bufferwrapper on top of passed byte array.
-
wrap
Buffer wrap(byte[] data, int offset, int length)
ReturnsBuffer, which wraps the part of byte array with specific offset and length.- Parameters:
data- byte array to wrapoffset- byte buffer offsetlength- byte buffer length- Returns:
Bufferwrapper on top of passed byte array.
-
wrap
Buffer wrap(java.lang.String s)
ReturnsBuffer, which wraps theString.- Parameters:
s-String- Returns:
Bufferwrapper on top of passedString.
-
wrap
Buffer wrap(java.lang.String s, java.nio.charset.Charset charset)
- Parameters:
s-Stringcharset-Charset, which will be used, when convertingStringto byte array.- Returns:
Bufferwrapper on top of passedString.
-
-