Package com.rabbitmq.client.impl
Class MethodArgumentWriter
- java.lang.Object
-
- com.rabbitmq.client.impl.MethodArgumentWriter
-
public class MethodArgumentWriter extends java.lang.ObjectGenerates AMQP wire-protocol encoded arguments. Methods on this object are usually called from autogenerated code.
-
-
Field Summary
Fields Modifier and Type Field Description private bytebitAccumulatorThe current group of bitsprivate intbitMaskThe current position within the group of bitsprivate booleanneedBitFlushWhen encoding one or more bits, records whether a group of bits is waiting to be writtenprivate ValueWriteroutWrites our output
-
Constructor Summary
Constructors Constructor Description MethodArgumentWriter(ValueWriter out)Constructs a MethodArgumentWriter targeting the given DataOutputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidbitflush()Private API - called when we may be transitioning from encoding a group of bits to encoding a non-bit value.voidflush()Public API - call this to ensure all accumulated argument values are correctly written to the output stream.private voidresetBitAccumulator()Private API - called to reset the bit group variables.voidwriteBit(boolean b)Public API - encodes a boolean/bit argument.voidwriteLong(int l)Public API - encodes an integer argument.voidwriteLonglong(long ll)Public API - encodes a long integer argument.voidwriteLongstr(LongString str)Public API - encodes a long string argument from a LongString.voidwriteLongstr(java.lang.String str)Public API - encodes a long string argument from a String.voidwriteOctet(byte octet)Public API - encodes an octet argument from a byte.voidwriteOctet(int octet)Public API - encodes an octet argument from an int.voidwriteShort(int s)Public API - encodes a short integer argument.voidwriteShortstr(java.lang.String str)Public API - encodes a short string argument.voidwriteTable(java.util.Map<java.lang.String,java.lang.Object> table)Public API - encodes a table argument.voidwriteTimestamp(java.util.Date timestamp)Public API - encodes a timestamp argument.
-
-
-
Field Detail
-
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 Detail
-
MethodArgumentWriter
public MethodArgumentWriter(ValueWriter out)
Constructs a MethodArgumentWriter targeting the given DataOutputStream.
-
-
Method Detail
-
resetBitAccumulator
private void resetBitAccumulator()
Private API - called to reset the bit group variables.
-
bitflush
private final void bitflush() throws java.io.IOExceptionPrivate API - called when we may be transitioning from encoding a group of bits to encoding a non-bit value.- Throws:
java.io.IOException
-
writeShortstr
public final void writeShortstr(java.lang.String str) throws java.io.IOExceptionPublic API - encodes a short string argument.- Throws:
java.io.IOException
-
writeLongstr
public final void writeLongstr(LongString str) throws java.io.IOException
Public API - encodes a long string argument from a LongString.- Throws:
java.io.IOException
-
writeLongstr
public final void writeLongstr(java.lang.String str) throws java.io.IOExceptionPublic API - encodes a long string argument from a String.- Throws:
java.io.IOException
-
writeShort
public final void writeShort(int s) throws java.io.IOExceptionPublic API - encodes a short integer argument.- Throws:
java.io.IOException
-
writeLong
public final void writeLong(int l) throws java.io.IOExceptionPublic API - encodes an integer argument.- Throws:
java.io.IOException
-
writeLonglong
public final void writeLonglong(long ll) throws java.io.IOExceptionPublic API - encodes a long integer argument.- Throws:
java.io.IOException
-
writeBit
public final void writeBit(boolean b) throws java.io.IOExceptionPublic API - encodes a boolean/bit argument.- Throws:
java.io.IOException
-
writeTable
public final void writeTable(java.util.Map<java.lang.String,java.lang.Object> table) throws java.io.IOExceptionPublic API - encodes a table argument.- Throws:
java.io.IOException
-
writeOctet
public final void writeOctet(int octet) throws java.io.IOExceptionPublic API - encodes an octet argument from an int.- Throws:
java.io.IOException
-
writeOctet
public final void writeOctet(byte octet) throws java.io.IOExceptionPublic API - encodes an octet argument from a byte.- Throws:
java.io.IOException
-
writeTimestamp
public final void writeTimestamp(java.util.Date timestamp) throws java.io.IOExceptionPublic API - encodes a timestamp argument.- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionPublic API - call this to ensure all accumulated argument values are correctly written to the output stream.- Throws:
java.io.IOException
-
-