Documentation of 'org.jlab.hipo.io.HipoByteUtils' Java class
HipoByteUtils
org.jlab.hipo.io

Class HipoByteUtils



  • public class HipoByteUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.util.TreeMap<java.lang.Integer,java.lang.Integer> bitMap 
      static int MTU 
    • Constructor Summary

      Constructors 
      Constructor and Description
      HipoByteUtils() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static byte[] compressLZ4(byte[] uncompressed) 
      static byte[] compressLZ4max(byte[] uncompressed) 
      static java.util.TreeMap<java.lang.Integer,java.lang.Integer> createBitMap() 
      static byte[] generateByteArray(int count) 
      static byte getByteFromInt(int data) 
      static byte getByteFromShort(short data)
      returns a byte from short number, anything that exceeds the number that fits in the byte they will be thrown away.
      static java.lang.String getByteString(int word)
      returns byte string representation of the given integer, with 32 bits 0 and 1.
      static int getInteger(int data, int bitstart, int bitend) 
      static int getIntFromByte(byte data) 
      static int getIntFromShort(short data) 
      static short getShortFromByte(byte data) 
      static short getShortFromInt(int data) 
      static byte[] gzip(byte[] ungzipped)
      returns the byte array GZIP compressed.
      static void main(java.lang.String[] args) 
      static void printBitMap() 
      static int read(int word, int start, int end)
      read specific bit from given integer.
      static int readLong(long word, int start, int end)
      read specific bit from given long.
      static void uncompressLZ4(byte[] compressed, byte[] uncompressed) 
      static byte[] ungzip(byte[] gzipped)
      The fastest Ungzip implementation.
      static int write(int word, int number, int start, int end)
      write a number to a specific bits of existing integer.
      static long writeLong(long word, int number, int start, int end)
      write a number to a specific bits of existing long (64-bits).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • bitMap

        public static java.util.TreeMap<java.lang.Integer,java.lang.Integer> bitMap
    • Constructor Detail

      • HipoByteUtils

        public HipoByteUtils()
    • Method Detail

      • createBitMap

        public static java.util.TreeMap<java.lang.Integer,java.lang.Integer> createBitMap()
      • uncompressLZ4

        public static void uncompressLZ4(byte[] compressed,
                                         byte[] uncompressed)
      • compressLZ4

        public static byte[] compressLZ4(byte[] uncompressed)
      • compressLZ4max

        public static byte[] compressLZ4max(byte[] uncompressed)
      • gzip

        public static byte[] gzip(byte[] ungzipped)
        returns the byte array GZIP compressed.
        Parameters:
        count -
        Returns:
      • ungzip

        public static byte[] ungzip(byte[] gzipped)
        The fastest Ungzip implementation. See PageInfoTest in ehcache-constructs. A high performance implementation, although not as fast as gunzip3. gunzips 100000 of ungzipped content in 9ms on the reference machine. It does not use a fixed size buffer and is therefore suitable for arbitrary length arrays.
        Parameters:
        gzipped -
        Returns:
        a plain, uncompressed byte[]
      • generateByteArray

        public static byte[] generateByteArray(int count)
      • printBitMap

        public static void printBitMap()
      • getInteger

        public static int getInteger(int data,
                                     int bitstart,
                                     int bitend)
      • getShortFromByte

        public static short getShortFromByte(byte data)
      • getIntFromShort

        public static int getIntFromShort(short data)
      • getIntFromByte

        public static int getIntFromByte(byte data)
      • getShortFromInt

        public static short getShortFromInt(int data)
      • getByteFromInt

        public static byte getByteFromInt(int data)
      • getByteFromShort

        public static byte getByteFromShort(short data)
        returns a byte from short number, anything that exceeds the number that fits in the byte they will be thrown away.
        Parameters:
        data - short data (2 bytes)
        Returns:
        a byte which is lower part of the given short (1 - byte)
      • getByteString

        public static java.lang.String getByteString(int word)
        returns byte string representation of the given integer, with 32 bits 0 and 1.
        Parameters:
        word - reference integer word
        Returns:
      • write

        public static int write(int word,
                                int number,
                                int start,
                                int end)
        write a number to a specific bits of existing integer. the specified bits are reset to 0 first then the provided number is written into specified bits
        Parameters:
        word - reference integer word (4 bits) is not changed
        number - and integer number written (user should check if the number fits)
        start - starting bits (first bit is 0)
        end - ending bit (for one bit start=end)
        Returns:
        returns a new integer with bits written
      • writeLong

        public static long writeLong(long word,
                                     int number,
                                     int start,
                                     int end)
        write a number to a specific bits of existing long (64-bits). the specified bits are reset to 0 first then the provided number is written into specified bits
        Parameters:
        word - reference integer word (4 bits) is not changed
        number - and integer number written (user should check if the number fits)
        start - starting bits (first bit is 0)
        end - ending bit (for one bit start=end)
        Returns:
        returns a new integer with bits written
      • read

        public static int read(int word,
                               int start,
                               int end)
        read specific bit from given integer.
        Parameters:
        word - integer reference word
        start - starting bit (0 being the first one)
        end - ending bit (for reading 1 bit start must be = to end)
        Returns:
      • readLong

        public static int readLong(long word,
                                   int start,
                                   int end)
        read specific bit from given long.
        Parameters:
        word - long reference word
        start - starting bit (0 being the first one)
        end - ending bit (for reading 1 bit start must be = to end)
        Returns:
      • main

        public static void main(java.lang.String[] args)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.