Android Guides | Samples

Javax.Crypto.Cipher.Update Method

Continues a multi-part transformation (encryption or decryption).

Syntax

[Android.Runtime.Register("update", "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I", "")]
public Int32 Update (ByteBuffer input, ByteBuffer output)

Parameters

input
the input buffer to transform.
output
the output buffer to store the result within.

Exceptions

TypeReason
ShortBufferExceptionif the size of the output buffer is too small.
IllegalStateExceptionif this cipher instance is not initialized for encryption or decryption.
IllegalArgumentExceptionif the input buffer and the output buffer are the identical object.

Remarks

Continues a multi-part transformation (encryption or decryption). The input.remaining() bytes starting at input.position() are transformed and stored in the output buffer.

If the output.remaining() is too small to hold the transformed bytes a ShortBufferException is thrown. Use Cipher.GetOutputSize(Int32) to check for the size of the output buffer.

[Android Documentation]

Requirements

Namespace: Javax.Crypto
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1