Top Description Methods
org.glassfish.grizzly.memory

public Interface WrapperAware

Known Direct Implementers
org.glassfish.grizzly.memory.ByteBufferManager, org.glassfish.grizzly.memory.HeapMemoryManager, org.glassfish.grizzly.memory.PooledMemoryManager
Imports
java.nio.ByteBuffer, java.nio.charset.Charset, org.glassfish.grizzly.Buffer

MemoryManagers, which implement this interface, are able to convert frequently used Java buffer types to Grizzly Buffer.
Author
Alexey Stashok
See Also
MemoryUtils, MemoryManager

Method Summary

Modifier and TypeMethod and Description
public Buffer

Returns:

Buffer wrapper on top of passed byte array.
wrap
(byte[]
byte array to wrap
data
)

Returns Buffer, which wraps the byte array.

public Buffer

Returns:

Buffer wrapper on top of passed byte array.
wrap
(byte[]
byte array to wrap
data
,
int
byte buffer offset
offset
,
int
byte buffer length
length
)

Returns Buffer, which wraps the part of byte array with specific offset and length.

public Buffer

Returns:

Buffer wrapper on top of passed String.
wrap
(String s)

Returns Buffer, which wraps the String.

public Buffer

Returns:

Buffer wrapper on top of passed String.
wrap
(String s, Charset
Charset, which will be used, when converting String to byte array.
charset
)

Returns Buffer, which wraps the String with the specific Charset.

public Buffer

Returns:

Buffer wrapper on top of passed ByteBuffer.
wrap
(ByteBuffer
ByteBuffer to wrap
byteBuffer
)

Returns Buffer, which wraps the ByteBuffer.

Method Detail

wrapback to summary
public Buffer wrap(byte[] data)

Returns Buffer, which wraps the byte array.

Parameters
data:byte[]

byte array to wrap

Returns:Buffer

Buffer wrapper on top of passed byte array.

wrapback to summary
public Buffer wrap(byte[] data, int offset, int length)

Returns Buffer, which wraps the part of byte array with specific offset and length.

Parameters
data:byte[]

byte array to wrap

offset:int

byte buffer offset

length:int

byte buffer length

Returns:Buffer

Buffer wrapper on top of passed byte array.

wrapback to summary
public Buffer wrap(String s)

Returns Buffer, which wraps the String.

Parameters
s:String

String

Returns:Buffer

Buffer wrapper on top of passed String.

wrapback to summary
public Buffer wrap(String s, Charset charset)

Returns Buffer, which wraps the String with the specific Charset.

Parameters
s:String

String

charset:Charset

Charset, which will be used, when converting String to byte array.

Returns:Buffer

Buffer wrapper on top of passed String.

wrapback to summary
public Buffer wrap(ByteBuffer byteBuffer)

Returns Buffer, which wraps the ByteBuffer.

Parameters
byteBuffer:ByteBuffer

ByteBuffer to wrap

Returns:Buffer

Buffer wrapper on top of passed ByteBuffer.