java.lang.Object
net.i2p.data.SimpleDataStructure
net.i2p.data.i2np.EncryptedBuildRecord
- All Implemented Interfaces:
DataStructure
- Direct Known Subclasses:
ShortEncryptedBuildRecord
ElGamal-encrypted request or response. 528 bytes. Previously stored in a ByteArray. May or may not be AES layer-encrypted.
Note that these are layer-encrypted and layer-decrypted in-place. Do not cache.
Field Summary
FieldsFields inherited from class SimpleDataStructure
_dataConstructor Summary
ConstructorsConstructorDescriptionEncryptedBuildRecord(byte[] data) Create a build record from the given encrypted data.Method Summary
All MethodsModifier and TypeMethodDescriptionintlength()The legal length of the byte array in this data structure.Methods inherited from class SimpleDataStructure
calculateHash, equals, fromBase64, fromByteArray, getData, hashCode, read, readBytes, setData, toBase64, toByteArray, toString, writeBytesModifier and TypeMethodDescriptionSHA256 hash of the byte array, or null if data is null.booleanCompares the raw data only: two different SimpleDataStructure subclasses of the same length holding the same bytes are equal, e.g.voidfromBase64(String data) Data from the base64 string.voidfromByteArray(byte[] data) Does the same thing asSimpleDataStructure.setData(byte[])but null not allowed.byte[]getData()Data reference (not a copy).inthashCode()We assume the data has enough randomness in it, so use the first 4 bytes for speed.protected intread(InputStream in, byte[] target) Repeated reads until the buffer is full or IOException is thrown.voidreadBytes(InputStream in) Data read from the stream.voidsetData(byte[] data) The byte array data, or null.toBase64()Renders the structure into modified base 64 notation.byte[]Same thing as getData().toString()Returns a string representation of this data structure.voidwriteBytes(OutputStream out) Writes the data to the output stream.
Field Details
LENGTH
Constructor Details
EncryptedBuildRecord
public EncryptedBuildRecord(byte[] data) Create a build record from the given encrypted data.- Parameters:
data- the encrypted record data- Throws:
IllegalArgumentException- if data is not correct length (null is ok)
Method Details
length
public int length()Description copied from class:SimpleDataStructureThe legal length of the byte array in this data structure.- Specified by:
lengthin classSimpleDataStructure- Returns:
- the legal length of the byte array