public class ArrayBufferInput extends java.lang.Object implements MessageBufferInput
| Constructor and Description |
|---|
ArrayBufferInput(byte[] arr) |
ArrayBufferInput(byte[] arr,
int offset,
int length) |
ArrayBufferInput(MessageBuffer buf) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the input.
|
MessageBuffer |
next()
Returns a next buffer to read.
|
void |
reset(byte[] arr) |
void |
reset(byte[] arr,
int offset,
int len) |
MessageBuffer |
reset(MessageBuffer buf)
Reset buffer.
|
public ArrayBufferInput(MessageBuffer buf)
public ArrayBufferInput(byte[] arr)
public ArrayBufferInput(byte[] arr,
int offset,
int length)
public MessageBuffer reset(MessageBuffer buf)
buf - new buffer. This can be null to make this input empty.public void reset(byte[] arr)
public void reset(byte[] arr,
int offset,
int len)
public MessageBuffer next()
MessageBufferInputThis method should return a MessageBuffer instance that has data filled in. When this method is called twice, the previously returned buffer is no longer used. Thus implementation of this method can safely discard it. This is useful when it uses a memory pool.
next in interface MessageBufferInputpublic void close()
MessageBufferInput
When this method is called, the buffer previously returned from MessageBufferInput.next() method is no longer used.
Thus implementation of this method can safely discard it.
If the input is already closed then invoking this method has no effect.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface MessageBufferInput