public final class CipherBlockHeaders extends Object
It contains the following fields in order:
Constructor and Description |
---|
CipherBlockHeaders()
Default constructor.
|
CipherBlockHeaders(byte[] nonce,
long contentLen)
Construct the single block headers using the provided nonce and length of content.
|
Modifier and Type | Method and Description |
---|---|
int |
deserialize(byte[] b,
int off)
Deserialize the provided bytes starting at the specified offset to construct an instance of
this class.
|
long |
getContentLength()
Return the content length set in the single block header.
|
byte[] |
getNonce()
Return the nonce set in the single block header.
|
boolean |
isComplete()
Check if this object has all the header fields populated and available for reading.
|
void |
setNonceLength(short nonceLength)
Set the length of the nonce used in the encryption of the content stored in the single block.
|
byte[] |
toByteArray()
Serialize the header into a byte array.
|
public CipherBlockHeaders()
public CipherBlockHeaders(byte[] nonce, long contentLen)
nonce
- the bytes containing the nonce.contentLen
- the length of the content in the block.public byte[] toByteArray()
public int deserialize(byte[] b, int off)
This method parses the provided bytes for the individual fields in this class. This methods also supports partial parsing where not all the bytes required for parsing the fields successfully are available.
b
- the byte array to deserialize.off
- the offset in the byte array to use for deserialization.public boolean isComplete()
public byte[] getNonce()
public long getContentLength()
public void setNonceLength(short nonceLength)
nonceLength
- the length of the nonce used in the encryption of the content stored in the
single block.Copyright © 2023. All rights reserved.