Class ValueReader


  • public class ValueReader
    extends java.lang.Object
    Helper class to read AMQP wire-protocol encoded values.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.DataInputStream in
      The stream we are reading from.
      private static long INT_MASK  
    • Constructor Summary

      Constructors 
      Constructor Description
      ValueReader​(java.io.DataInputStream in)
      Construct a MethodArgumentReader streaming over the given DataInputStream.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.util.List<java.lang.Object> readArray​(java.io.DataInputStream in)
      Read a field-array
      private static byte[] readBytes​(java.io.DataInputStream in)
      Convenience method - reads a 32-bit-length-prefix byte vector from a DataInputStream.
      (package private) static java.lang.Object readFieldValue​(java.io.DataInputStream in)  
      int readLong()
      Public API - reads an integer.
      long readLonglong()
      Public API - reads a long integer.
      LongString readLongstr()
      Public API - reads a long string.
      private static LongString readLongstr​(java.io.DataInputStream in)
      Convenience method - reads a long string argument from a DataInputStream.
      int readOctet()
      Public API - reads an octet.
      int readShort()
      Public API - reads a short integer.
      java.lang.String readShortstr()
      Public API - reads a short string.
      private static java.lang.String readShortstr​(java.io.DataInputStream in)
      Convenience method - reads a short string from a DataInput Stream.
      java.util.Map<java.lang.String,​java.lang.Object> readTable()
      Public API - reads a table.
      private static java.util.Map<java.lang.String,​java.lang.Object> readTable​(java.io.DataInputStream in)
      Reads a table argument from a given stream.
      java.util.Date readTimestamp()
      Public API - reads an timestamp.
      private static java.util.Date readTimestamp​(java.io.DataInputStream in)
      Convenience method - reads a timestamp argument from the DataInputStream.
      private static long readUnsignedInt​(java.io.DataInputStream in)
      Read an unsigned int
      private static long unsignedExtend​(int value)
      Protected API - Cast an int to a long without extending the sign bit of the int out into the high half of the long.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • in

        private final java.io.DataInputStream in
        The stream we are reading from.
    • Constructor Detail

      • ValueReader

        public ValueReader​(java.io.DataInputStream in)
        Construct a MethodArgumentReader streaming over the given DataInputStream.
    • Method Detail

      • unsignedExtend

        private static long unsignedExtend​(int value)
        Protected API - Cast an int to a long without extending the sign bit of the int out into the high half of the long.
      • readShortstr

        private static java.lang.String readShortstr​(java.io.DataInputStream in)
                                              throws java.io.IOException
        Convenience method - reads a short string from a DataInput Stream.
        Throws:
        java.io.IOException
      • readShortstr

        public final java.lang.String readShortstr()
                                            throws java.io.IOException
        Public API - reads a short string.
        Throws:
        java.io.IOException
      • readBytes

        private static byte[] readBytes​(java.io.DataInputStream in)
                                 throws java.io.IOException
        Convenience method - reads a 32-bit-length-prefix byte vector from a DataInputStream.
        Throws:
        java.io.IOException
      • readLongstr

        private static LongString readLongstr​(java.io.DataInputStream in)
                                       throws java.io.IOException
        Convenience method - reads a long string argument from a DataInputStream.
        Throws:
        java.io.IOException
      • readLongstr

        public final LongString readLongstr()
                                     throws java.io.IOException
        Public API - reads a long string.
        Throws:
        java.io.IOException
      • readShort

        public final int readShort()
                            throws java.io.IOException
        Public API - reads a short integer.
        Throws:
        java.io.IOException
      • readLong

        public final int readLong()
                           throws java.io.IOException
        Public API - reads an integer.
        Throws:
        java.io.IOException
      • readLonglong

        public final long readLonglong()
                                throws java.io.IOException
        Public API - reads a long integer.
        Throws:
        java.io.IOException
      • readTable

        private static java.util.Map<java.lang.String,​java.lang.Object> readTable​(java.io.DataInputStream in)
                                                                                 throws java.io.IOException
        Reads a table argument from a given stream. Also called by ContentHeaderPropertyReader.
        Throws:
        java.io.IOException
      • readFieldValue

        static java.lang.Object readFieldValue​(java.io.DataInputStream in)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • readUnsignedInt

        private static long readUnsignedInt​(java.io.DataInputStream in)
                                     throws java.io.IOException
        Read an unsigned int
        Throws:
        java.io.IOException
      • readArray

        private static java.util.List<java.lang.Object> readArray​(java.io.DataInputStream in)
                                                           throws java.io.IOException
        Read a field-array
        Throws:
        java.io.IOException
      • readTable

        public final java.util.Map<java.lang.String,​java.lang.Object> readTable()
                                                                               throws java.io.IOException
        Public API - reads a table.
        Throws:
        java.io.IOException
      • readOctet

        public final int readOctet()
                            throws java.io.IOException
        Public API - reads an octet.
        Throws:
        java.io.IOException
      • readTimestamp

        private static java.util.Date readTimestamp​(java.io.DataInputStream in)
                                             throws java.io.IOException
        Convenience method - reads a timestamp argument from the DataInputStream.
        Throws:
        java.io.IOException
      • readTimestamp

        public final java.util.Date readTimestamp()
                                           throws java.io.IOException
        Public API - reads an timestamp.
        Throws:
        java.io.IOException