Package org.rcsb.cif.binary.data
Interface NumberArray<D>
- Type Parameters:
D- the type of number array wrapped (int[] or double[])
- All Superinterfaces:
EncodedData<D>
- All Known Subinterfaces:
FloatArray,IntArray,SignedIntArray<T>,UnsignedIntArray
- All Known Implementing Classes:
Float32Array,Float64Array,Int16Array,Int32Array,Int8Array,Uint16Array,Uint32Array,Uint8Array
public interface NumberArray<D> extends EncodedData<D>
An array of numbers.
-
Method Summary
Modifier and Type Method Description ByteArrayencode()Encode this array of numbers directly as binary data (useful for single values that won't benefit from more elaborate encoding chains).intgetNumberOfBytes()The number of bytes used in this representation to describe a single value (e.g.intgetType()Report the type of this number array.byte[]toByteArray()Converts this number array to its binary representation.Methods inherited from interface org.rcsb.cif.binary.data.EncodedData
decode, getData, getEncoding, hasNextDecodingStep, length, setEncoding
-
Method Details
-
toByteArray
byte[] toByteArray()Converts this number array to its binary representation.- Returns:
- a byte[]
-
getNumberOfBytes
int getNumberOfBytes()The number of bytes used in this representation to describe a single value (e.g. 1 forInt8Arrayand up to 8 forFloat64Array).- Returns:
- a number between 1 and 4
-
getType
int getType()Report the type of this number array.- 1 for
Int8Array - 2 for
Int16Array - 3 for
Int32Array - 4 for
Uint8Array - 5 for
Uint16Array - 6 for
Uint32Array - 32 for
Float32Array - 33 for
Float64Array
- Returns:
- 1, 2, 3, 4, 5, 6, 32, 33
- 1 for
-
encode
ByteArray encode()Encode this array of numbers directly as binary data (useful for single values that won't benefit from more elaborate encoding chains).- Returns:
- a
ByteArraywith a single encoding step
-