/// <summary> /// This compress algorithm only works for 8, 16 or 32 bit data types. /// </summary> /// <param name="dataType"></param> /// <returns></returns> public bool QueryDataTypeSupported(EPT dataType) { int nBits = dataType.GetBitCount(); return (nBits == 8 || nBits == 16 || nBits == 32); }
/// <summary> /// Creates a new instance of HfaCompress from the data byte, and starts at the data offset. /// </summary> public HfaCompress(byte[] data, long dataOffset, int blockSize, EPT dataType) { _compressed = false; _data = data; _dataOffset = dataOffset; _dataTypeNumBits = dataType.GetBitCount(); _blockSize = blockSize; _blockCount = blockSize/(_dataTypeNumBits/8); // Allocate memory for the count and values, probably too big // about right for worst case scenario _counts = new byte[_blockSize + sizeof(UInt32)]; _values = new byte[_blockSize + sizeof(UInt32)]; }