Class ByteBufferInput
- java.lang.Object
-
- com.batch.android.msgpack.core.buffer.ByteBufferInput
-
- All Implemented Interfaces:
MessageBufferInput,java.io.Closeable,java.lang.AutoCloseable
public class ByteBufferInput extends java.lang.Object implements MessageBufferInput
MessageBufferInputadapter forByteBuffer
-
-
Constructor Summary
Constructors Constructor Description ByteBufferInput(java.nio.ByteBuffer input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the input.MessageBuffernext()Returns a next buffer to read.java.nio.ByteBufferreset(java.nio.ByteBuffer input)Reset buffer.
-
-
-
Method Detail
-
reset
public java.nio.ByteBuffer reset(java.nio.ByteBuffer input)
Reset buffer.- Parameters:
input- new buffer- Returns:
- the old buffer
-
next
public MessageBuffer next()
Description copied from interface:MessageBufferInputReturns a next buffer to read.This 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.
- Specified by:
nextin interfaceMessageBufferInput- Returns:
- the next MessageBuffer, or return null if no more buffer is available.
-
close
public void close()
Description copied from interface:MessageBufferInputCloses the input.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.
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceMessageBufferInput
-
-