Package org.apache.thrift
Class TBaseHelper
java.lang.Object
org.apache.thrift.TBaseHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe largest initial capacity a wire-supplied container element count may reserve. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]byteBufferToByteArray(ByteBuffer byteBuffer) static intbyteBufferToByteArray(ByteBuffer byteBuffer, byte[] target, int offset) static intcompareTo(boolean a, boolean b) static intcompareTo(byte[] a, byte[] b) static intcompareTo(byte a, byte b) static intcompareTo(double a, double b) static intcompareTo(int a, int b) static intcompareTo(long a, long b) static intcompareTo(short a, short b) static intcompareTo(Comparable a, Comparable b) static intstatic intstatic intstatic intstatic intstatic byte[]copyBinary(byte[] orig) static ByteBuffercopyBinary(ByteBuffer orig) static inthashCode(double value) static inthashCode(long value) static StringpaddedByteString(byte b) static intpreallocSize(int size) Returns the initial capacity to reserve for a container whose declared element count issize.static ByteBufferrightSize(ByteBuffer in) static voidtoString(ByteBuffer bb, StringBuilder sb) static voidtoString(Collection<ByteBuffer> bbs, StringBuilder sb) static booleanwrapsFullArray(ByteBuffer byteBuffer)
-
Field Details
-
MAX_PREALLOC_SIZE
public static final int MAX_PREALLOC_SIZEThe 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
-
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
-
compareTo
public static int compareTo(byte[] a, byte[] b) -
compareTo
-
compareTo
-
compareTo
-
compareTo
-
toString
-
toString
-
paddedByteString
-
byteBufferToByteArray
-
wrapsFullArray
-
byteBufferToByteArray
-
rightSize
-
copyBinary
-
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 issize. 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 overflowsint) reserves nothing. Used by generated code.
-