Package org.rcsb.cif.binary.codec
Class ByteArrayCodec
- java.lang.Object
-
- org.rcsb.cif.binary.codec.ByteArrayCodec
-
public class ByteArrayCodec extends Object
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 }
-
-
Constructor Summary
Constructors Constructor Description ByteArrayCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NumberArray<?>decode(ByteArray data, ByteArrayEncoding encoding)<D> ByteArrayencode(NumberArray<D> data, ByteArrayEncoding encoding)
-
-
-
Method Detail
-
encode
public <D> ByteArray encode(NumberArray<D> data, ByteArrayEncoding encoding)
-
decode
public NumberArray<?> decode(ByteArray data, ByteArrayEncoding encoding)
-
-