Class FrameReaderUtils


  • public class FrameReaderUtils
    extends Object
    Utility methods used by various entities that read data from Frame objects.
    • Constructor Detail

      • FrameReaderUtils

        public FrameReaderUtils()
    • Method Detail

      • readByteBuffer

        public static ByteBuffer readByteBuffer​(org.apache.datasketches.memory.Memory memory,
                                                long dataStart,
                                                int dataLength)
        Returns a ByteBuffer containing data from the provided Memory. The ByteBuffer is always newly created, so it is OK to change its position, limit, etc. However, it may point directly to the backing memory of the Memory object, so it is not OK to write to its contents.
      • compareMemoryUnsigned

        public static int compareMemoryUnsigned​(org.apache.datasketches.memory.Memory memory1,
                                                long position1,
                                                long length1,
                                                org.apache.datasketches.memory.Memory memory2,
                                                long position2,
                                                long length2)
        Compares two Memory ranges using unsigned byte ordering. Different from Memory.compareTo(long, long, org.apache.datasketches.memory.Memory, long, long), which uses signed ordering.
      • compareMemoryToByteArrayUnsigned

        public static int compareMemoryToByteArrayUnsigned​(org.apache.datasketches.memory.Memory memory,
                                                           long position1,
                                                           long length1,
                                                           byte[] array,
                                                           int position2,
                                                           int length2)
        Compares Memory with a byte array using unsigned byte ordering.
      • compareByteArraysUnsigned

        public static int compareByteArraysUnsigned​(byte[] array1,
                                                    int position1,
                                                    int length1,
                                                    byte[] array2,
                                                    int position2,
                                                    int length2)
        Compares two byte arrays using unsigned byte ordering.