Class Data

All Implemented Interfaces:
Comparable<Item>, Iterable<Item>, Debug, Display

public class Data extends Value
  • Constructor Details

    • Data

      protected Data(byte[] array, int offset, int size)
    • Data

      public Data(int initialCapacity)
    • Data

      public Data()
  • Method Details

    • isConstant

      public boolean isConstant()
      Description copied from class: Item
      Returns true if this Item always evaluates to the same Item.
      Specified by:
      isConstant in class Item
    • size

      public final int size()
    • getByte

      public byte getByte(int index)
    • setByte

      public Data setByte(int index, byte value)
    • addByte

      public Data addByte(byte value)
    • addByteArray

      public Data addByteArray(byte[] array, int offset, int size)
    • addByteArray

      public Data addByteArray(byte[] array)
    • addData

      public Data addData(Data data)
    • clear

      public void clear()
    • toByteArray

      public byte[] toByteArray()
    • asByteArray

      public byte[] asByteArray()
    • toByteBuffer

      public ByteBuffer toByteBuffer()
    • asByteBuffer

      public ByteBuffer asByteBuffer()
    • toInputBuffer

      public InputBuffer toInputBuffer()
    • isAliased

      public boolean isAliased()
      isAliased in class Value
    • isMutable

      public boolean isMutable()
      isMutable in class Value
    • branch

      public Data branch()
      branch in class Value
    • commit

      public Data commit()
      Description copied from class: Item
      Flags this Item as immutable, recursively if it is a Record, then returns this Item.
      commit in class Value
    • writer

      public Writer<?,?> writer()
    • write

      public Writer<?,?> write(Output<?> output)
    • writeBase16

      public Writer<?,?> writeBase16(Output<?> output, Base16 base16)
    • writeBase16

      public Writer<?,?> writeBase16(Output<?> output)
    • toBase16

      public String toBase16(Base16 base16)
    • toBase16

      public String toBase16()
    • writeBase64

      public Writer<?,?> writeBase64(Output<?> output, Base64 base64)
    • writeBase64

      public Writer<?,?> writeBase64(Output<?> output)
    • toBase64

      public String toBase64(Base64 base64)
    • toBase64

      public String toBase64()
    • typeOrder

      public int typeOrder()
      Description copied from class: Item
      Returns the heterogeneous sort order of this Item. Used to impose a total order on the set of all items. When comparing two items of different types, the items order according to their typeOrder.
      Specified by:
      typeOrder in class Item
    • compareTo

      public int compareTo(Item other)
      Specified by:
      compareTo in interface Comparable<Item>
      Specified by:
      compareTo in class Item
    • equals

      public boolean equals(Object other)
      Specified by:
      equals in class Item
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Item
    • debug

      public <T> Output<T> debug(Output<T> output)
      Description copied from interface: Debug
      Writes a developer readable, debug-formatted string representation of this object to output.
      Specified by:
      debug in interface Debug
      Specified by:
      debug in class Item
      the continuation of the output.
    • empty

      public static Data empty()
    • create

      public static Data create()
    • create

      public static Data create(int initialCapacity)
    • wrap

      public static Data wrap(ByteBuffer buffer)
    • wrap

      public static Data wrap(byte[] array, int offset, int size)
    • wrap

      public static Data wrap(byte[] array)
    • from

      public static Data from(ByteBuffer buffer)
    • fromBase16

      public static Data fromBase16(String string)
    • fromBase64

      public static Data fromBase64(String string, Base64 base64)
    • fromBase64

      public static Data fromBase64(String string)
    • fromUtf8

      public static Data fromUtf8(String string)
    • output

      public static Output<Data> output(Data data)
    • output

      public static Output<Data> output(int initialCapacity)
    • output

      public static Output<Data> output()