# 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
public final 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/androidx/media3/datasource/AesFlushingCipher#AesFlushingCipher(int,byte[],long,long)(int mode, byte[] secretKey, long nonce, long offset)` |
| `https://developer.android.com/reference/androidx/media3/datasource/AesFlushingCipher#AesFlushingCipher(int,byte[],java.lang.String,long)( int mode, byte[] secretKey, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html nonce, long offset )` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/datasource/AesFlushingCipher#update(byte[],int,int,byte[],int)(byte[] in, int inOffset, int length, byte[] out, int outOffset)` |
| `void` | `https://developer.android.com/reference/androidx/media3/datasource/AesFlushingCipher#updateInPlace(byte[],int,int)(byte[] data, int offset, int length)` |

## Public constructors

### AesFlushingCipher

```
public AesFlushingCipher(int mode, byte[] secretKey, long nonce, long offset)
```

### AesFlushingCipher

```
public AesFlushingCipher(
    int mode,
    byte[] secretKey,
    @Nullable String nonce,
    long offset
)
```

## Public methods

### update

```
public void update(byte[] in, int inOffset, int length, byte[] out, int outOffset)
```

### updateInPlace

```
public void updateInPlace(byte[] data, int offset, int length)
```