Class Binary

    • Field Detail

      • isBackingBytesReused

        protected boolean isBackingBytesReused
      • EMPTY

        public static final Binary EMPTY
    • Method Detail

      • toStringUsingUTF8

        public abstract String toStringUsingUTF8()
      • length

        public abstract int length()
      • 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)
      • toByteBuffer

        public abstract ByteBuffer toByteBuffer()
      • 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)
      • fromString

        public static Binary fromString​(String value)
      • lexicographicCompare

        public static int lexicographicCompare​(Binary one,
                                               Binary other)