Class ByteArrayDataType

java.lang.Object
io.permazen.kv.mvstore.ByteArrayDataType
All Implemented Interfaces:
Comparator<byte[]>, org.h2.mvstore.type.DataType<byte[]>

public final class ByteArrayDataType extends Object implements org.h2.mvstore.type.DataType<byte[]>
MVStore DataType implementation encoding byte[] arrays sorted lexicographically.
  • Field Details

  • Method Details

    • binarySearch

      public int binarySearch(byte[] key, Object storage, int size, int initialGuess)
      Specified by:
      binarySearch in interface org.h2.mvstore.type.DataType<byte[]>
    • compare

      public int compare(byte[] a, byte[] b)
      Specified by:
      compare in interface Comparator<byte[]>
      Specified by:
      compare in interface org.h2.mvstore.type.DataType<byte[]>
    • createStorage

      public byte[][] createStorage(int size)
      Specified by:
      createStorage in interface org.h2.mvstore.type.DataType<byte[]>
    • getMemory

      public int getMemory(byte[] value)
      Specified by:
      getMemory in interface org.h2.mvstore.type.DataType<byte[]>
    • isMemoryEstimationAllowed

      public boolean isMemoryEstimationAllowed()
      Specified by:
      isMemoryEstimationAllowed in interface org.h2.mvstore.type.DataType<byte[]>
    • write

      public void write(org.h2.mvstore.WriteBuffer buf, byte[] value)
      Specified by:
      write in interface org.h2.mvstore.type.DataType<byte[]>
    • write

      public void write(org.h2.mvstore.WriteBuffer buf, Object storage, int len)
      Specified by:
      write in interface org.h2.mvstore.type.DataType<byte[]>
    • read

      public byte[] read(ByteBuffer buf)
      Specified by:
      read in interface org.h2.mvstore.type.DataType<byte[]>
    • read

      public void read(ByteBuffer buf, Object storage, int len)
      Specified by:
      read in interface org.h2.mvstore.type.DataType<byte[]>