Class TBaseHelper

java.lang.Object
org.apache.thrift.TBaseHelper

public final class TBaseHelper extends Object
  • Field Details

    • MAX_PREALLOC_SIZE

      public static final int MAX_PREALLOC_SIZE
      The largest initial capacity a wire-supplied container element count may reserve. A container header is read before any of its elements, so a peer can name an element count it never backs with data.
      See Also:
  • Method Details

    • compareTo

      public static int compareTo(Object o1, Object o2)
    • compareTo

      public static int compareTo(boolean a, boolean b)
    • compareTo

      public static int compareTo(byte a, byte b)
    • compareTo

      public static int compareTo(short a, short b)
    • compareTo

      public static int compareTo(int a, int b)
    • compareTo

      public static int compareTo(long a, long b)
    • compareTo

      public static int compareTo(double a, double b)
    • compareTo

      public static int compareTo(String a, String b)
    • compareTo

      public static int compareTo(byte[] a, byte[] b)
    • compareTo

      public static int compareTo(Comparable a, Comparable b)
    • compareTo

      public static int compareTo(List a, List b)
    • compareTo

      public static int compareTo(Set a, Set b)
    • compareTo

      public static int compareTo(Map a, Map b)
    • toString

      public static void toString(Collection<ByteBuffer> bbs, StringBuilder sb)
    • toString

      public static void toString(ByteBuffer bb, StringBuilder sb)
    • paddedByteString

      public static String paddedByteString(byte b)
    • byteBufferToByteArray

      public static byte[] byteBufferToByteArray(ByteBuffer byteBuffer)
    • wrapsFullArray

      public static boolean wrapsFullArray(ByteBuffer byteBuffer)
    • byteBufferToByteArray

      public static int byteBufferToByteArray(ByteBuffer byteBuffer, byte[] target, int offset)
    • rightSize

      public static ByteBuffer rightSize(ByteBuffer in)
    • copyBinary

      public static ByteBuffer copyBinary(ByteBuffer orig)
    • copyBinary

      public static byte[] copyBinary(byte[] orig)
    • hashCode

      public static int hashCode(long value)
    • hashCode

      public static int hashCode(double value)
    • preallocSize

      public static int preallocSize(int size)
      Returns the initial capacity to reserve for a container whose declared element count is size. Capping what the count reserves up front keeps that cost proportional to the bytes actually sent, while still reserving exact capacity for containers that fit under the cap; larger containers grow as elements are added. A negative count (which can also arise when a count is doubled for a hash container and overflows int) reserves nothing. Used by generated code.