# FilteringManifestParser

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

*** ** * ** ***


```
@UnstableApi
public final class FilteringManifestParser<T extends FilterableManifest<T>> implements ParsingLoadable.Parser<T>
```

<br />

*** ** * ** ***

A manifest parser that includes only the streams identified by the given stream keys.

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/androidx/media3/exoplayer/offline/FilterableManifest<T>>` | The `https://developer.android.com/reference/androidx/media3/exoplayer/offline/FilterableManifest` type. |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/offline/FilteringManifestParser#FilteringManifestParser(androidx.media3.exoplayer.upstream.ParsingLoadable.Parser<? extends T>,java.util.List<androidx.media3.common.StreamKey>)( https://developer.android.com/reference/androidx/media3/exoplayer/upstream/ParsingLoadable.Parser<T> parser, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/StreamKey> streamKeys )` |

| ### Public methods |
|---|---|
| `T` | `https://developer.android.com/reference/androidx/media3/exoplayer/offline/FilteringManifestParser#parse(android.net.Uri,java.io.InputStream)(https://developer.android.com/reference/android/net/Uri.html uri, https://developer.android.com/reference/java/io/InputStream.html inputStream)` Parses an object from a response. |

## Public constructors

### FilteringManifestParser

```
public FilteringManifestParser(
    ParsingLoadable.Parser<T> parser,
    @Nullable List<StreamKey> streamKeys
)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/ParsingLoadable.Parser<T> parser` | A parser for the manifest that will be filtered. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/StreamKey> streamKeys` | The stream keys. If null or empty then filtering will not occur. |

## Public methods

### parse

```
public T parse(Uri uri, InputStream inputStream)
```

Parses an object from a response.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/net/Uri.html uri` | The source `https://developer.android.com/reference/android/net/Uri.html` of the response, after any redirection. |
| `https://developer.android.com/reference/java/io/InputStream.html inputStream` | An `https://developer.android.com/reference/java/io/InputStream.html` from which the response data can be read. |

| Returns |
|---|---|
| `T` | The parsed object. |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/ParserException` | If an error occurs parsing the data. |
| `https://developer.android.com/reference/java/io/IOException.html` | If an error occurs reading data from the stream. |