Package org.rcsb.cif.binary.encoding
Class IntegerPackingEncoding
java.lang.Object
org.rcsb.cif.binary.encoding.IntegerPackingEncoding
- All Implemented Interfaces:
Encoding<Int32Array,IntArray>
public class IntegerPackingEncoding extends Object implements Encoding<Int32Array,IntArray>
Stores a Int32Array using 8- or 16-bit values. Includes the size of the input array for easier decoding.
The encoding is more effective when only unsigned values are provided.
IntegerPacking {
kind = "IntegerPacking"
byteCount: number
srcSize: number
isUnsigned: boolean
}
Example
[1, 2, -3, 128]
---IntegerPacking--->
{ byteCount = 1, srcSize = 4, isUnsigned = false } [1, 2, -3, 127, 1]
-
Constructor Summary
Constructors Constructor Description IntegerPackingEncoding()IntegerPackingEncoding(int byteCount, boolean isUnsigned, int srcSize) -
Method Summary
Modifier and Type Method Description Int32Arraydecode(IntArray data)Move one step up the encoding deque.IntArrayencode(Int32Array data)Move one step down the encoding deque.Map<String,Object>getMapRepresentation()Converts this encoding to its map representation that can be serialized as BinaryCif.StringtoString()
-
Constructor Details
-
IntegerPackingEncoding
public IntegerPackingEncoding() -
IntegerPackingEncoding
public IntegerPackingEncoding(int byteCount, boolean isUnsigned, int srcSize)
-
-
Method Details
-
getMapRepresentation
Description copied from interface:EncodingConverts this encoding to its map representation that can be serialized as BinaryCif.- Specified by:
getMapRepresentationin interfaceEncoding<Int32Array,IntArray>- Returns:
- a Map that contains all encoding information
-
decode
Description copied from interface:EncodingMove one step up the encoding deque. One step closer to the original representation of the data.- Specified by:
decodein interfaceEncoding<Int32Array,IntArray>- Parameters:
data- the container to decode- Returns:
- the decoded information
-
encode
Description copied from interface:EncodingMove one step down the encoding deque. One step closer to aByteArrayrepresentation.- Specified by:
encodein interfaceEncoding<Int32Array,IntArray>- Parameters:
data- the container to encode- Returns:
- the decoded information
-
toString
-