Package io.trino.hive.formats
Class ReadWriteUtils
java.lang.Object
io.trino.hive.formats.ReadWriteUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intcalculateTruncationLength(Type type, io.airlift.slice.Slice slice, int offset, int length) static intcomputeVIntLength(int value) static intdecodeVIntSize(byte value) static intdecodeVIntSize(io.airlift.slice.Slice slice, int offset) static longfindFirstSyncPosition(TrinoInputFile inputFile, long offset, long length, long syncFirst, long syncSecond) Find the beginning of the first full sync sequence that starts within the specified range.static booleanisNegativeVInt(byte value) static booleanisNegativeVInt(io.airlift.slice.Slice slice, int offset) static longreadVInt(io.airlift.slice.SliceInput in) static longreadVInt(io.airlift.slice.Slice slice, int start) static longreadVInt(io.airlift.slice.Slice slice, int start, int length) static longstatic voidwriteLengthPrefixedString(DataOutputStream out, io.airlift.slice.Slice slice) static voidwriteVInt(io.airlift.slice.SliceOutput out, int value) static voidwriteVInt(DataOutputStream out, int value) static voidwriteVLong(io.airlift.slice.SliceOutput out, long value)
-
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
- 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
- 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)
-