Interface MessageBufferInput
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
ArrayBufferInput,ByteBufferInput,ChannelBufferInput,InputStreamBufferInput
public interface MessageBufferInput extends java.io.CloseableProvides a sequence of MessageBuffer instances.A MessageBufferInput implementation has control of lifecycle of the memory so that it can reuse previously allocated memory, use memory pools, or use memory-mapped files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes the input.MessageBuffernext()Returns a next buffer to read.
-
-
-
Method Detail
-
next
MessageBuffer next() throws java.io.IOException
Returns 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.
- Returns:
- the next MessageBuffer, or return null if no more buffer is available.
- Throws:
java.io.IOException- when IO error occurred when reading the data
-
close
void close() throws java.io.IOExceptionCloses the input.When this method is called, the buffer previously returned from
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- Throws:
java.io.IOException- when IO error occurred when closing the data source
-
-