Package zmq

Class Msg

Direct Known Subclasses:
Msg.Builder

public class Msg extends Object
  • Field Details

  • Constructor Details

    • Msg

      public Msg()
    • Msg

      public Msg(int capacity)
    • Msg

      public Msg(byte[] src)
    • Msg

      public Msg(ByteBuffer src)
    • Msg

      public Msg(Msg m)
    • Msg

      private Msg(Msg src, ByteArrayOutputStream out)
  • Method Details

    • isIdentity

      public boolean isIdentity()
    • isDelimiter

      public boolean isDelimiter()
    • check

      public boolean check()
    • flags

      public int flags()
    • hasMore

      public boolean hasMore()
    • isCommand

      public boolean isCommand()
    • isCredential

      public boolean isCredential()
    • setFlags

      public void setFlags(int flags)
    • initDelimiter

      public void initDelimiter()
    • data

      public byte[] data()
      Returns the message data. If possible, a reference to the data is returned, without copy. Otherwise a new byte array will be allocated and the data will be copied.
      Returns:
      the message data.
    • buf

      public ByteBuffer buf()
    • size

      public int size()
    • resetFlags

      public void resetFlags(int f)
    • setFd

      public void setFd(SocketChannel fileDesc)
    • fd

      public SocketChannel fd()
    • getMetadata

      public Metadata getMetadata()
    • setMetadata

      public Msg setMetadata(Metadata metadata)
    • resetMetadata

      public void resetMetadata()
    • get

      public byte get()
    • get

      public byte get(int index)
    • put

      public Msg put(byte b)
    • put

      public Msg put(int b)
    • put

      protected Msg put(int index, byte b)
    • put

      public Msg put(byte[] src)
    • put

      public Msg put(byte[] src, int off, int len)
    • put

      public Msg put(ByteBuffer src, int off, int len)
    • put

      public Msg put(ByteBuffer src)
    • getBytes

      public int getBytes(int index, byte[] dst, int off, int len)
    • getBytes

      public int getBytes(int index, ByteBuffer bb, int len)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getWriteIndex

      protected final int getWriteIndex()
    • setWriteIndex

      protected final void setWriteIndex(int writeIndex)
    • getLong

      public long getLong(int offset)
    • getInt

      public int getInt(int offset)
    • getShort

      public int getShort(int offset)
    • transfer

      public void transfer(ByteBuffer destination, int srcOffset, int srcLength)
    • putShortString

      public Msg putShortString(String data)
      Puts a string into the message, prefixed with its length. Users shall size the message by adding 1 to the length of the string: It needs to be able to accommodate (data.length+1) more bytes.
      Parameters:
      data - a string shorter than 256 characters. If null, defaults to a no-op.
      Returns:
      the same message.