Class ProtonEncodings

java.lang.Object
org.apache.qpid.protonj2.codec.encoders.ProtonEncodings

public final class ProtonEncodings extends Object
Static method that perform some of the most common type encodings that have well defined formats that don't need further lookups or null checks etc.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Write the Binary value into to provided buffer using the most compact AMQP encoding possible based on the size of the buffer contents.
    static void
    Write the DeliveryTag bytes value into to provided buffer using the most compact AMQP encoding possible based on the size of the tag buffer contents.
    static void
    writeString(ProtonBuffer buffer, EncoderState state, String value)
    Write the String value into to provided buffer using the most compact AMQP encoding possible based on the size of the String contents.
    static void
    Write the Symbol value into to provided buffer using the most compact AMQP encoding possible based on the size of the Symbol contents.
    static void
    Write the Symbol value into to provided buffer using the most compact AMQP encoding possible based on the size of the Symbol contents.
    static void
    writeUnsignedInteger(ProtonBuffer buffer, byte value)
    Write the byte value that carries the unsigned integer using the most compact AMQP encoding possible based on the value of the integer provided.
    static void
    writeUnsignedInteger(ProtonBuffer buffer, int value)
    Write the integer value that carries the unsigned integer using the most compact AMQP encoding possible based on the value of the integer provided.
    static void
    writeUnsignedInteger(ProtonBuffer buffer, long value)
    Write the long value that carries the unsigned integer using the most compact AMQP encoding possible based on the value of the long provided.
    static void
    writeUnsignedLong(ProtonBuffer buffer, byte value)
    Write the byte value that carries the unsigned long value using the most compact AMQP encoding possible based on the value of the long.
    static void
    writeUnsignedLong(ProtonBuffer buffer, long value)
    Write the long value that carries the unsigned long value using the most compact AMQP encoding possible based on the value of the long.

    Methods inherited from class java.lang.Object

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

    • writeUnsignedInteger

      public static void writeUnsignedInteger(ProtonBuffer buffer, byte value)
      Write the byte value that carries the unsigned integer using the most compact AMQP encoding possible based on the value of the integer provided.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The unsigned integer value to write carried in a java primitive
    • writeUnsignedInteger

      public static void writeUnsignedInteger(ProtonBuffer buffer, int value)
      Write the integer value that carries the unsigned integer using the most compact AMQP encoding possible based on the value of the integer provided.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The unsigned integer value to write carried in a java primitive
    • writeUnsignedInteger

      public static void writeUnsignedInteger(ProtonBuffer buffer, long value)
      Write the long value that carries the unsigned integer using the most compact AMQP encoding possible based on the value of the long provided. The value must has already been checked for overflow by the object calling this method.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The unsigned integer value to write carried in a java primitive
    • writeUnsignedLong

      public static void writeUnsignedLong(ProtonBuffer buffer, byte value)
      Write the byte value that carries the unsigned long value using the most compact AMQP encoding possible based on the value of the long.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The unsigned long value to write carried in a java primitive
    • writeUnsignedLong

      public static void writeUnsignedLong(ProtonBuffer buffer, long value)
      Write the long value that carries the unsigned long value using the most compact AMQP encoding possible based on the value of the long.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The unsigned long value to write carried in a java primitive
    • writeSymbol

      public static void writeSymbol(ProtonBuffer buffer, String value)
      Write the Symbol value into to provided buffer using the most compact AMQP encoding possible based on the size of the Symbol contents.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The Symbol value carried in the given String to write
    • writeSymbol

      public static void writeSymbol(ProtonBuffer buffer, Symbol value)
      Write the Symbol value into to provided buffer using the most compact AMQP encoding possible based on the size of the Symbol contents.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The Symbol value to write into the buffer
    • writeString

      public static void writeString(ProtonBuffer buffer, EncoderState state, String value)
      Write the String value into to provided buffer using the most compact AMQP encoding possible based on the size of the String contents.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The String value to write into the buffer
    • writeBinary

      public static void writeBinary(ProtonBuffer buffer, ProtonBuffer value)
      Write the Binary value into to provided buffer using the most compact AMQP encoding possible based on the size of the buffer contents.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The ProtonBuffer value to write into the buffer as a Binary encoding
    • writeDeliveryTag

      public static void writeDeliveryTag(ProtonBuffer buffer, DeliveryTag value)
      Write the DeliveryTag bytes value into to provided buffer using the most compact AMQP encoding possible based on the size of the tag buffer contents.
      Parameters:
      buffer - The buffer where the encoding should be written to
      value - The DeliveryTag value to write into the buffer as a Binary encoding