net.named_data.jndn.util
public class SignedBlob extends Blob
Constructor and Description |
---|
SignedBlob()
Create a new SignedBlob with a null pointer and 0 for the offsets.
|
SignedBlob(Blob blob,
int signedPortionBeginOffset,
int signedPortionEndOffset)
Create a new SignedBlob and take another pointer to the given blob's
buffer.
|
SignedBlob(byte[] value,
boolean copy,
int signedPortionBeginOffset,
int signedPortionEndOffset)
Create a new SignedBlob from the the byte array.
|
SignedBlob(ByteBuffer buffer,
boolean copy,
int signedPortionBeginOffset,
int signedPortionEndOffset)
Create a new SignedBlob from an existing ByteBuffer.
|
SignedBlob(SignedBlob signedBlob)
Create a new SignedBlob as a copy of the given signedBlob.
|
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
signedBuf()
Get a new read-only ByteBuffer for the signed portion of the byte buffer.
|
int |
signedSize()
Get the length of the signed portion of the immutable byte buffer.
|
public SignedBlob()
public SignedBlob(SignedBlob signedBlob)
signedBlob
- The SignedBlob to copy.public SignedBlob(Blob blob, int signedPortionBeginOffset, int signedPortionEndOffset)
blob
- The Blob from which we take another pointer to the same buffer.signedPortionBeginOffset
- The offset in the buffer of the beginning
of the signed portion.signedPortionEndOffset
- The offset in the buffer of the end of the
signed portion.public SignedBlob(ByteBuffer buffer, boolean copy, int signedPortionBeginOffset, int signedPortionEndOffset)
buffer
- The existing ByteBuffer. It is important that the buffer
position and limit are correct.copy
- If true, copy the contents into a new byte array. If false,
just take a slice which uses the existing byte array in buffer.signedPortionBeginOffset
- The offset in the buffer of the beginning
of the signed portion.signedPortionEndOffset
- The offset in the buffer of the end of the
signed portion.public SignedBlob(byte[] value, boolean copy, int signedPortionBeginOffset, int signedPortionEndOffset)
value
- The byte array. If copy is true, this makes a copy.copy
- If true, copy the contents into a new byte array. If false,
just use ByteBuffer.wrap which uses the existing byte array.signedPortionBeginOffset
- The offset in the buffer of the beginning
of the signed portion.signedPortionEndOffset
- The offset in the buffer of the end of the
signed portion.public final int signedSize()
public final ByteBuffer signedBuf()
Copyright © 2016. All rights reserved.