Class MethodArgumentWriter

java.lang.Object
com.rabbitmq.client.impl.MethodArgumentWriter

public class MethodArgumentWriter extends Object
Generates AMQP wire-protocol encoded arguments. Methods on this object are usually called from autogenerated code.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private byte
    The current group of bits
    private int
    The current position within the group of bits
    private boolean
    When encoding one or more bits, records whether a group of bits is waiting to be written
    private final ValueWriter
    Writes our output
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a MethodArgumentWriter targeting the given DataOutputStream.
  • Method Summary

    Modifier and Type
    Method
    Description
    private final void
    Private API - called when we may be transitioning from encoding a group of bits to encoding a non-bit value.
    void
    Public API - call this to ensure all accumulated argument values are correctly written to the output stream.
    private void
    Private API - called to reset the bit group variables.
    final void
    writeBit(boolean b)
    Public API - encodes a boolean/bit argument.
    final void
    writeLong(int l)
    Public API - encodes an integer argument.
    final void
    writeLonglong(long ll)
    Public API - encodes a long integer argument.
    final void
    Public API - encodes a long string argument from a LongString.
    final void
    Public API - encodes a long string argument from a String.
    final void
    writeOctet(byte octet)
    Public API - encodes an octet argument from a byte.
    final void
    writeOctet(int octet)
    Public API - encodes an octet argument from an int.
    final void
    writeShort(int s)
    Public API - encodes a short integer argument.
    final void
    Public API - encodes a short string argument.
    final void
    Public API - encodes a table argument.
    final void
    writeTimestamp(Date timestamp)
    Public API - encodes a timestamp argument.

    Methods inherited from class java.lang.Object

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

    • out

      private final ValueWriter out
      Writes our output
    • needBitFlush

      private boolean needBitFlush
      When encoding one or more bits, records whether a group of bits is waiting to be written
    • bitAccumulator

      private byte bitAccumulator
      The current group of bits
    • bitMask

      private int bitMask
      The current position within the group of bits
  • Constructor Details

    • MethodArgumentWriter

      public MethodArgumentWriter(ValueWriter out)
      Constructs a MethodArgumentWriter targeting the given DataOutputStream.
  • Method Details

    • resetBitAccumulator

      private void resetBitAccumulator()
      Private API - called to reset the bit group variables.
    • bitflush

      private final void bitflush() throws IOException
      Private API - called when we may be transitioning from encoding a group of bits to encoding a non-bit value.
      Throws:
      IOException
    • writeShortstr

      public final void writeShortstr(String str) throws IOException
      Public API - encodes a short string argument.
      Throws:
      IOException
    • writeLongstr

      public final void writeLongstr(LongString str) throws IOException
      Public API - encodes a long string argument from a LongString.
      Throws:
      IOException
    • writeLongstr

      public final void writeLongstr(String str) throws IOException
      Public API - encodes a long string argument from a String.
      Throws:
      IOException
    • writeShort

      public final void writeShort(int s) throws IOException
      Public API - encodes a short integer argument.
      Throws:
      IOException
    • writeLong

      public final void writeLong(int l) throws IOException
      Public API - encodes an integer argument.
      Throws:
      IOException
    • writeLonglong

      public final void writeLonglong(long ll) throws IOException
      Public API - encodes a long integer argument.
      Throws:
      IOException
    • writeBit

      public final void writeBit(boolean b) throws IOException
      Public API - encodes a boolean/bit argument.
      Throws:
      IOException
    • writeTable

      public final void writeTable(Map<String,Object> table) throws IOException
      Public API - encodes a table argument.
      Throws:
      IOException
    • writeOctet

      public final void writeOctet(int octet) throws IOException
      Public API - encodes an octet argument from an int.
      Throws:
      IOException
    • writeOctet

      public final void writeOctet(byte octet) throws IOException
      Public API - encodes an octet argument from a byte.
      Throws:
      IOException
    • writeTimestamp

      public final void writeTimestamp(Date timestamp) throws IOException
      Public API - encodes a timestamp argument.
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Public API - call this to ensure all accumulated argument values are correctly written to the output stream.
      Throws:
      IOException