Package org.rcsb.cif.binary.encoding
Class ByteArrayEncoding<T extends NumberArray<?>>
java.lang.Object
org.rcsb.cif.binary.encoding.ByteArrayEncoding<T>
public abstract class ByteArrayEncoding<T extends NumberArray<?>> extends Object implements Encoding<T,ByteArray>
Encodes an array of numbers of specified types as raw bytes. E.g. values in the range from 0...255 (i.e. an
Uint8Array) can be efficiently represented by single byte rather than int values which would require four
bytes.
ByteArray {
kind = "ByteArray"
type: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Float32Array | Float64Array
}
-
Field Summary
Fields Modifier and Type Field Description static ByteArrayEncoding<Float32Array>FLOAT32static ByteArrayEncoding<Float64Array>FLOAT64static ByteArrayEncoding<Int16Array>INT16static ByteArrayEncoding<Int32Array>INT32static ByteArrayEncoding<Int8Array>INT8static ByteArrayEncoding<Uint16Array>UINT16static ByteArrayEncoding<Uint32Array>UINT32static ByteArrayEncoding<Uint8Array>UINT8 -
Method Summary
-
Field Details
-
Method Details
-
encode
Description copied from interface:EncodingMove one step down the encoding deque. One step closer to aByteArrayrepresentation.- Specified by:
encodein interfaceEncoding<T extends NumberArray<?>,ByteArray>- Parameters:
data- the container to encode- Returns:
- the decoded information
-
getMapRepresentation
Description copied from interface:EncodingConverts this encoding to its map representation that can be serialized as BinaryCif.- Specified by:
getMapRepresentationin interfaceEncoding<T extends NumberArray<?>,ByteArray>- Returns:
- a Map that contains all encoding information
-
toString
-