Class ReadWriteUtils

java.lang.Object
io.trino.hive.formats.ReadWriteUtils

public final class ReadWriteUtils extends Object
  • Method Details

    • decodeVIntSize

      public static int decodeVIntSize(io.airlift.slice.Slice slice, int offset)
    • decodeVIntSize

      public static int decodeVIntSize(byte value)
    • isNegativeVInt

      public static boolean isNegativeVInt(io.airlift.slice.Slice slice, int offset)
    • isNegativeVInt

      public static boolean isNegativeVInt(byte value)
    • readVInt

      public static long readVInt(TrinoDataInputStream in) throws IOException
      Throws:
      IOException
    • readVInt

      public static long readVInt(io.airlift.slice.SliceInput in)
    • readVInt

      public static long readVInt(io.airlift.slice.Slice slice, int start)
    • readVInt

      public static long readVInt(io.airlift.slice.Slice slice, int start, int length)
    • findFirstSyncPosition

      public static long findFirstSyncPosition(TrinoInputFile inputFile, long offset, long length, long syncFirst, long syncSecond) throws IOException
      Find the beginning of the first full sync sequence that starts within the specified range.
      Throws:
      IOException
    • writeLengthPrefixedString

      public static void writeLengthPrefixedString(DataOutputStream out, io.airlift.slice.Slice slice) throws IOException
      Throws:
      IOException
    • writeVInt

      public static void writeVInt(DataOutputStream out, int value) throws IOException
      Throws:
      IOException
    • computeVIntLength

      public static int computeVIntLength(int value)
    • writeVInt

      public static void writeVInt(io.airlift.slice.SliceOutput out, int value)
    • writeVLong

      public static void writeVLong(io.airlift.slice.SliceOutput out, long value)
    • calculateTruncationLength

      public static int calculateTruncationLength(Type type, io.airlift.slice.Slice slice, int offset, int length)