public interface CryptoHandler
The implementations of this interface provided in this package currently process bytes in a single block mode (where all input data is processed in entirety, or in a framing mode (where data is processed incrementally in chunks).
Modifier and Type | Method and Description |
---|---|
int |
doFinal(byte[] out,
int outOff)
Finish processing of the bytes.
|
int |
estimateFinalOutputSize()
Return the size of the output buffer required for a call to
doFinal(byte[], int) . |
int |
estimateOutputSize(int inLen)
Return the size of the output buffer required for a
processBytes(byte[], int, int,
byte[], int) plus a doFinal(byte[], int) call with an input of inLen bytes. |
int |
estimatePartialOutputSize(int inLen)
Return the size of the output buffer required for a call to
processBytes(byte[], int,
int, byte[], int) . |
boolean |
isComplete()
For decrypt and parsing flows returns
true when this has handled as many bytes as it
can. |
ProcessingSummary |
processBytes(byte[] in,
int inOff,
int inLen,
byte[] out,
int outOff)
Process a block of bytes from
in putting the result into out . |
ProcessingSummary processBytes(byte[] in, int inOff, int inLen, byte[] out, int outOff)
in
putting the result into out
.in
- the input byte array.inOff
- the offset into the in
array where the data to be processed starts.inLen
- the number of bytes to be processed.out
- the output buffer the processed bytes go into.outOff
- the offset into the output byte array the processed data starts at.out
and the number of bytes parsed.int doFinal(byte[] out, int outOff)
out
- the output buffer for copying any remaining output data.outOff
- offset into out
to start copying the output data.out
.int estimateOutputSize(int inLen)
processBytes(byte[], int, int,
byte[], int)
plus a doFinal(byte[], int)
call with an input of inLen
bytes.
Note this method is allowed to return an estimation of the output size that is greater than the actual size of the output. Returning an estimate that is lesser than the actual size of the output will result in underflow exceptions.
inLen
- the length of the input.doFinal(byte[],
int)
with an input of size inLen
bytes.int estimatePartialOutputSize(int inLen)
processBytes(byte[], int,
int, byte[], int)
.
Note this method is allowed to return an estimation of the output size that is greater than the actual size of the output. Returning an estimate that is lesser than the actual size of the output will result in underflow exceptions.
inLen
- the length of the input.processBytes(byte[], int, int,
byte[], int)
with an input of size inLen
bytes.int estimateFinalOutputSize()
doFinal(byte[], int)
.
Note this method is allowed to return an estimation of the output size that is greater than the actual size of the output. Returning an estimate that is lesser than the actual size of the output will result in underflow exceptions.
doFinal(byte[], int)
boolean isComplete()
true
when this has handled as many bytes as it
can. This usually means that it has reached the end of an object, file, or other delimited
stream.Copyright © 2023. All rights reserved.