# AesFlushingCipher

Artifact: [androidx.media3:media3-datasource](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/datasource/AesFlushingCipher.java+class:androidx.media3.datasource.AesFlushingCipher)

*** ** * ** ***


```
@UnstableApi
class AesFlushingCipher
```

<br />

*** ** * ** ***

A flushing variant of a AES/CTR/NoPadding `https://docs.oracle.com/javase/8/docs/api/javax/crypto/Cipher.html`.

Unlike a regular `https://docs.oracle.com/javase/8/docs/api/javax/crypto/Cipher.html`, the update methods of this class are guaranteed to process all of the bytes input (and hence output the same number of bytes).

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/AesFlushingCipher#AesFlushingCipher(int,byte[],long,long)( mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, secretKey: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!, nonce: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/AesFlushingCipher#AesFlushingCipher(int,byte[],java.lang.String,long)( mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, secretKey: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!, nonce: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/AesFlushingCipher#update(byte[],int,int,byte[],int)( in: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!, inOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, length: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, out: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!, outOffset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/AesFlushingCipher#updateInPlace(byte[],int,int)(data: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, length: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

## Public constructors

### AesFlushingCipher

```
AesFlushingCipher(
    mode: Int,
    secretKey: ByteArray<Byte>!,
    nonce: Long,
    offset: Long
)
```

### AesFlushingCipher

```
AesFlushingCipher(
    mode: Int,
    secretKey: ByteArray<Byte>!,
    nonce: String?,
    offset: Long
)
```

## Public functions

### update

```
fun update(
    in: ByteArray<Byte>!,
    inOffset: Int,
    length: Int,
    out: ByteArray<Byte>!,
    outOffset: Int
): Unit
```

### updateInPlace

```
fun updateInPlace(data: ByteArray<Byte>!, offset: Int, length: Int): Unit
```