public abstract class DataStructureImpl extends Object implements DataStructure, Serializable
| Constructor and Description |
|---|
DataStructureImpl() |
| Modifier and Type | Method and Description |
|---|---|
Hash | calculateHash()Calculate the SHA256 value of this object (useful for a few scenarios) |
void | fromBase64(String data)Load the structure from the provided base64 string. |
void | fromByteArray(byte[] data)Loads structure from the data provided
Warning - many classes will throw IllegalStateException if data is already set. |
protected int | read(InputStream in,
byte[] target)Repeated reads until buffer is full or IOException is thrown |
String | toBase64()render the structure into modified base 64 notation |
byte[] | toByteArray()Convert the structure to a byte array. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadBytes, writeBytespublic Hash calculateHash()
DataStructurecalculateHash in interface DataStructurepublic void fromBase64(String data) throws DataFormatException
DataStructurefromBase64 in interface DataStructuredata - base64 encoded string to load fromDataFormatException - if the data format is invalidpublic void fromByteArray(byte[] data)
throws DataFormatExceptionDataStructurefromByteArray in interface DataStructuredata - byte array to load fromDataFormatException - if the data format is invalidprotected int read(InputStream in, byte[] target) throws IOException
in - input stream to read fromtarget - byte array to read intoIOException - if an I/O error occurspublic String toBase64()
DataStructuretoBase64 in interface DataStructurepublic byte[] toByteArray()
DataStructuretoByteArray in interface DataStructure