Package org.rcsb.cif.binary.data
Class ByteArray
java.lang.Object
org.rcsb.cif.binary.data.ByteArray
- All Implemented Interfaces:
EncodedData<byte[]>
public class ByteArray extends Object
The abstraction of binary data.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description <T extends NumberArray<?>>
Tdecode(ByteArrayEncoding<T> encoding)StringArraydecode(StringArrayEncoding encoding)byte[]getData()Access to the underlying array of information.Deque<Encoding<?,?>>getEncoding()All encodings registered for this piece of EncodedData.booleanhasNextDecodingStep()Convenience method to state whether the List returned byEncodedData.getEncoding()is not empty.intlength()The number of elements in the wrapped array.voidsetEncoding(Deque<Encoding<?,?>> encoding)Replace this encoding chain with a different one.StringtoString()
-
Constructor Details
-
Method Details
-
getData
public byte[] getData()Description copied from interface:EncodedDataAccess to the underlying array of information.- Returns:
- an int[], double[], byte[], or String[]
-
length
public int length()Description copied from interface:EncodedDataThe number of elements in the wrapped array.- Returns:
- results of array.length
-
toString
-
decode
-
decode
-
getEncoding
Description copied from interface:EncodedDataAll encodings registered for this piece of EncodedData. May be empty. May contain only partial data: e.g. adding a ByteArrayEncoding to the list will request encoding by ByteArrayCodec, this method call will subsequently fill all fields of the requested Encoding to allow for decoding.- Specified by:
getEncodingin interfaceEncodedData<D>- Returns:
- all associated Encoding instances
-
setEncoding
Description copied from interface:EncodedDataReplace this encoding chain with a different one.- Specified by:
setEncodingin interfaceEncodedData<D>- Parameters:
encoding- the new encoding chain for this instance
-
hasNextDecodingStep
public boolean hasNextDecodingStep()Description copied from interface:EncodedDataConvenience method to state whether the List returned byEncodedData.getEncoding()is not empty.- Specified by:
hasNextDecodingStepin interfaceEncodedData<D>- Returns:
- true if encoding steps are registered and need to be resolved to access decoded data
-