Interface WritableMessage

All Known Subinterfaces:
Buffer, FileChunk
All Known Implementing Classes:
BuffersBuffer, ByteBufferManager.SmallByteBufferWrapper, ByteBufferWrapper, CompositeBuffer, FileTransfer, HeapBuffer

public interface WritableMessage
Common interface for entities that may be written to a Channel.
Since:
2.2
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return true if this message has data remaining to be written.
    boolean
    Returns true if the message represents an external resource (for example FileTransfer), which is not loaded in memory.
    boolean
    Perform message specific actions to release resources held by the entity backing this WritableMessage.
    int
    Return the number of bytes remaining to be written.
  • Method Details

    • hasRemaining

      boolean hasRemaining()
      Return true if this message has data remaining to be written.
      Returns:
      true if this message has data remaining to be written.
    • remaining

      int remaining()
      Return the number of bytes remaining to be written.
      Returns:
      the number of bytes remaining to be written.
    • release

      boolean release()
      Perform message specific actions to release resources held by the entity backing this WritableMessage.
      Returns:
      true if successfully released
    • isExternal

      boolean isExternal()
      Returns true if the message represents an external resource (for example FileTransfer), which is not loaded in memory.
      Returns:
      False, if the message is located in memory (like Buffer).