Udostępnij za pośrednictwem


Cipher.Update Method

Definition

Overloads

Update(Byte[])

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

Update(ByteBuffer, ByteBuffer)

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

Update(Byte[], Int32, Int32)

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

Update(Byte[], Int32, Int32, Byte[])

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

Update(Byte[], Int32, Int32, Byte[], Int32)

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

Update(Byte[])

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

[Android.Runtime.Register("update", "([B)[B", "")]
public byte[]? Update (byte[]? input);
[<Android.Runtime.Register("update", "([B)[B", "")>]
member this.Update : byte[] -> byte[]

Parameters

input
Byte[]

the input buffer

Returns

Byte[]

the new buffer with the result, or null if the underlying cipher is a block cipher and the input data is too short to result in a new block.

Attributes

Exceptions

if this cipher instance is not initialized for encryption or decryption.

if the input is null.

Remarks

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

The bytes in the input buffer are processed, and the result is stored in a new buffer.

If input has a length of zero, this method returns null.

Java documentation for javax.crypto.Cipher.update(byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Update(ByteBuffer, ByteBuffer)

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

[Android.Runtime.Register("update", "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I", "")]
public int Update (Java.Nio.ByteBuffer? input, Java.Nio.ByteBuffer? output);
[<Android.Runtime.Register("update", "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I", "")>]
member this.Update : Java.Nio.ByteBuffer * Java.Nio.ByteBuffer -> int

Parameters

input
ByteBuffer

the input ByteBuffer

output
ByteBuffer

the output ByteByffer

Returns

the number of bytes stored in output

Attributes

Exceptions

if the size of the output buffer is too small.

if this cipher instance is not initialized for encryption or decryption.

if the input buffer and the output buffer are the identical object.

Remarks

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

All input.remaining() bytes starting at input.position() are processed. The result is stored in the output buffer. Upon return, the input buffer's position will be equal to its limit; its limit will not have changed. The output buffer's position will have advanced by n, where n is the value returned by this method; the output buffer's limit will not have changed.

If output.remaining() bytes are insufficient to hold the result, a ShortBufferException is thrown. In this case, repeat this call with a larger output buffer. Use #getOutputSize(int) getOutputSize to determine how big the output buffer should be.

Note: this method should be copy-safe, which means the input and output buffers can reference the same block of memory and no unprocessed input data is overwritten when the result is copied into the output buffer.

Added in 1.5.

Java documentation for javax.crypto.Cipher.update(java.nio.ByteBuffer, java.nio.ByteBuffer).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Update(Byte[], Int32, Int32)

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

[Android.Runtime.Register("update", "([BII)[B", "")]
public byte[]? Update (byte[]? input, int inputOffset, int inputLen);
[<Android.Runtime.Register("update", "([BII)[B", "")>]
member this.Update : byte[] * int * int -> byte[]

Parameters

input
Byte[]

the input buffer

inputOffset
Int32

the offset in input where the input starts

inputLen
Int32

the input length

Returns

Byte[]

the new buffer with the result, or null if the underlying cipher is a block cipher and the input data is too short to result in a new block.

Attributes

Exceptions

if this cipher instance is not initialized for encryption or decryption.

if input is null, or if inputOffset and inputLen do not specify a valid chunk in the input buffer.

Remarks

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

The first inputLen bytes in the input buffer, starting at inputOffset inclusive, are processed, and the result is stored in a new buffer.

If inputLen is zero, this method returns null.

Java documentation for javax.crypto.Cipher.update(byte[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Update(Byte[], Int32, Int32, Byte[])

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

[Android.Runtime.Register("update", "([BII[B)I", "")]
public int Update (byte[]? input, int inputOffset, int inputLen, byte[]? output);
[<Android.Runtime.Register("update", "([BII[B)I", "")>]
member this.Update : byte[] * int * int * byte[] -> int

Parameters

input
Byte[]

the input buffer

inputOffset
Int32

the offset in input where the input starts

inputLen
Int32

the input length

output
Byte[]

the buffer for the result

Returns

the number of bytes stored in output

Attributes

Exceptions

if the size of the output buffer is too small.

if this cipher instance is not initialized for encryption or decryption.

if the input is null, the output is null, or if inputOffset and inputLen do not specify a valid chunk in the input buffer.

Remarks

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

The first inputLen bytes in the input buffer, starting at inputOffset inclusive, are processed, and the result is stored in the output buffer.

If the output buffer is too small to hold the result, a ShortBufferException is thrown. In this case, repeat this call with a larger output buffer. Use #getOutputSize(int) getOutputSize to determine how big the output buffer should be.

If inputLen is zero, this method returns a length of zero.

Note: this method should be copy-safe, which means the input and output buffers can reference the same byte array and no unprocessed input data is overwritten when the result is copied into the output buffer.

Java documentation for javax.crypto.Cipher.update(byte[], int, int, byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Update(Byte[], Int32, Int32, Byte[], Int32)

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

[Android.Runtime.Register("update", "([BII[BI)I", "")]
public int Update (byte[]? input, int inputOffset, int inputLen, byte[]? output, int outputOffset);
[<Android.Runtime.Register("update", "([BII[BI)I", "")>]
member this.Update : byte[] * int * int * byte[] * int -> int

Parameters

input
Byte[]

the input buffer

inputOffset
Int32

the offset in input where the input starts

inputLen
Int32

the input length

output
Byte[]

the buffer for the result

outputOffset
Int32

the offset in output where the result is stored

Returns

the number of bytes stored in output

Attributes

Exceptions

if the size of the output buffer is too small.

if this cipher instance is not initialized for encryption or decryption.

if the input is null, the output is null, or if inputOffset and inputLen do not specify a valid chunk in the input buffer.

Remarks

Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

The first inputLen bytes in the input buffer, starting at inputOffset inclusive, are processed, and the result is stored in the output buffer, starting at outputOffset inclusive.

If the output buffer is too small to hold the result, a ShortBufferException is thrown. In this case, repeat this call with a larger output buffer. Use #getOutputSize(int) getOutputSize to determine how big the output buffer should be.

If inputLen is zero, this method returns a length of zero.

Note: this method should be copy-safe, which means the input and output buffers can reference the same byte array and no unprocessed input data is overwritten when the result is copied into the output buffer.

Java documentation for javax.crypto.Cipher.update(byte[], int, int, byte[], int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to