Package zmq

Class Msg

  • Direct Known Subclasses:
    Msg.Builder

    public class Msg
    extends java.lang.Object
    • Constructor Detail

      • Msg

        public Msg()
      • Msg

        public Msg​(int capacity)
      • Msg

        public Msg​(byte[] src)
      • Msg

        public Msg​(java.nio.ByteBuffer src)
      • Msg

        public Msg​(Msg m)
      • Msg

        private Msg​(Msg src,
                    java.io.ByteArrayOutputStream out)
    • Method Detail

      • 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 java.nio.ByteBuffer buf()
      • size

        public int size()
      • resetFlags

        public void resetFlags​(int f)
      • setFd

        public void setFd​(java.nio.channels.SocketChannel fileDesc)
      • fd

        public java.nio.channels.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​(java.nio.ByteBuffer src,
                       int off,
                       int len)
      • put

        public Msg put​(java.nio.ByteBuffer src)
      • getBytes

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

        public int getBytes​(int index,
                            java.nio.ByteBuffer bb,
                            int len)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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​(java.nio.ByteBuffer destination,
                             int srcOffset,
                             int srcLength)
      • putShortString

        public Msg putShortString​(java.lang.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.