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:
  • Field Details

    • isBackingBytesReused

      protected boolean isBackingBytesReused
    • EMPTY

      public static final Binary EMPTY
  • Method Details

    • 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. The Comparator implementation for the related type available at PrimitiveType.comparator() should be used instead.
      Specified by:
      compareTo in interface Comparable<Binary>
    • toByteBuffer

      public abstract ByteBuffer toByteBuffer()
    • get2BytesLittleEndian

      public short get2BytesLittleEndian()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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.
    • fromString

      public static Binary fromString(String value)
    • fromCharSequence

      public static Binary fromCharSequence(CharSequence value)
    • lexicographicCompare

      public static int lexicographicCompare(Binary one, Binary other)