Package org.apache.parquet.io.api
Class Binary
- java.lang.Object
-
- org.apache.parquet.io.api.Binary
-
- All Implemented Interfaces:
Serializable,Comparable<Binary>
public abstract class Binary extends Object implements Comparable<Binary>, Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static BinaryEMPTYprotected booleanisBackingBytesReused
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract intcompareTo(Binary other)Deprecated.will be removed in 2.0.0.Binarycopy()booleanequals(Object obj)static BinaryfromByteArray(byte[] value)Deprecated.static BinaryfromByteArray(byte[] value, int offset, int length)Deprecated.static BinaryfromByteBuffer(ByteBuffer value)Deprecated.static BinaryfromCharSequence(CharSequence value)static BinaryfromConstantByteArray(byte[] value)static BinaryfromConstantByteArray(byte[] value, int offset, int length)static BinaryfromConstantByteBuffer(ByteBuffer value)static BinaryfromConstantByteBuffer(ByteBuffer value, int offset, int length)static BinaryfromReusedByteArray(byte[] value)static BinaryfromReusedByteArray(byte[] value, int offset, int length)static BinaryfromReusedByteBuffer(ByteBuffer value)static BinaryfromReusedByteBuffer(ByteBuffer value, int offset, int length)static BinaryfromString(String value)abstract byte[]getBytes()abstract byte[]getBytesUnsafe()Variant of getBytes() that avoids copying backing data structure by returning backing byte[] of the Binary.booleanisBackingBytesReused()Signals if backing bytes are owned, and can be modified, by producer of the Binaryabstract intlength()static intlexicographicCompare(Binary one, Binary other)abstract Binaryslice(int start, int length)abstract ByteBuffertoByteBuffer()StringtoString()abstract StringtoStringUsingUTF8()abstract voidwriteTo(DataOutput out)abstract voidwriteTo(OutputStream out)
-
-
-
Field Detail
-
isBackingBytesReused
protected boolean isBackingBytesReused
-
EMPTY
public static final Binary EMPTY
-
-
Method Detail
-
toStringUsingUTF8
public abstract String toStringUsingUTF8()
-
length
public abstract int length()
-
writeTo
public abstract void writeTo(OutputStream out) throws IOException
- Throws:
IOException
-
writeTo
public abstract void writeTo(DataOutput out) throws IOException
- Throws:
IOException
-
getBytes
public abstract byte[] getBytes()
-
getBytesUnsafe
public abstract byte[] getBytesUnsafe()
Variant of getBytes() that avoids copying backing data structure by returning backing byte[] of the Binary. Do not modify backing byte[] unless you know what you are doing.- Returns:
- backing byte[] of correct size, with an offset of 0, if possible, else returns result of getBytes()
-
slice
public abstract Binary slice(int start, int length)
-
compareTo
@Deprecated public abstract int compareTo(Binary other)
Deprecated.will be removed in 2.0.0. The comparison logic depends on the related logical type therefore this one might not be correct. TheComparatorimplementation for the related type available atPrimitiveType.comparator()should be used instead.- Specified by:
compareToin interfaceComparable<Binary>
-
toByteBuffer
public abstract ByteBuffer toByteBuffer()
-
copy
public Binary copy()
-
isBackingBytesReused
public boolean isBackingBytesReused()
Signals if backing bytes are owned, and can be modified, by producer of the Binary- Returns:
- if backing bytes are held on by producer of the Binary
-
fromReusedByteArray
public static Binary fromReusedByteArray(byte[] value, int offset, int length)
-
fromConstantByteArray
public static Binary fromConstantByteArray(byte[] value, int offset, int length)
-
fromByteArray
@Deprecated public static Binary fromByteArray(byte[] value, int offset, int length)
Deprecated.
-
fromReusedByteArray
public static Binary fromReusedByteArray(byte[] value)
-
fromConstantByteArray
public static Binary fromConstantByteArray(byte[] value)
-
fromByteArray
@Deprecated public static Binary fromByteArray(byte[] value)
Deprecated.
-
fromReusedByteBuffer
public static Binary fromReusedByteBuffer(ByteBuffer value, int offset, int length)
-
fromConstantByteBuffer
public static Binary fromConstantByteBuffer(ByteBuffer value, int offset, int length)
-
fromReusedByteBuffer
public static Binary fromReusedByteBuffer(ByteBuffer value)
-
fromConstantByteBuffer
public static Binary fromConstantByteBuffer(ByteBuffer value)
-
fromByteBuffer
@Deprecated public static Binary fromByteBuffer(ByteBuffer value)
Deprecated.
-
fromCharSequence
public static Binary fromCharSequence(CharSequence value)
-
-