Back to Exoplayer

ForwardingExtractorInput (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/extractor/ForwardingExtractorInput.html

latest19.3 KB
Original Source

Package com.google.android.exoplayer2.extractor

Class ForwardingExtractorInput

  • java.lang.Object

    • com.google.android.exoplayer2.extractor.ForwardingExtractorInput
  • All Implemented Interfaces:ExtractorInput, DataReader


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classForwardingExtractorInputextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

An overridable ExtractorInput implementation forwarding all methods to another input.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | ForwardingExtractorInput​(ExtractorInput input) | Deprecated. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | advancePeekPosition​(int length) | Deprecated.

Advances the peek position by length bytes. | | boolean | advancePeekPosition​(int length, boolean allowEndOfInput) | Deprecated.

Advances the peek position by length bytes. | | long | getLength() | Deprecated.

Returns the length of the source stream, or C.LENGTH_UNSET if it is unknown. | | long | getPeekPosition() | Deprecated.

Returns the current peek position (byte offset) in the stream. | | long | getPosition() | Deprecated.

Returns the current read position (byte offset) in the stream. | | int | peek​(byte[] target, int offset, int length) | Deprecated.

Peeks up to length bytes from the peek position. | | void | peekFully​(byte[] target, int offset, int length) | Deprecated.

Equivalent to peekFully(target, offset, length, false). | | boolean | peekFully​(byte[] target, int offset, int length, boolean allowEndOfInput) | Deprecated.

Like ExtractorInput.peek(byte[], int, int), but peeks the requested length in full. | | int | read​(byte[] buffer, int offset, int length) | Deprecated.

Reads up to length bytes from the input and resets the peek position. | | void | readFully​(byte[] target, int offset, int length) | Deprecated.

Equivalent to readFully(target, offset, length, false). | | boolean | readFully​(byte[] target, int offset, int length, boolean allowEndOfInput) | Deprecated.

Like ExtractorInput.read(byte[], int, int), but reads the requested length in full. | | void | resetPeekPosition() | Deprecated.

Resets the peek position to equal the current read position. | | <E extends Throwable>void | setRetryPosition​(long position, E e) | Deprecated.

Called when reading fails and the required retry position is different from the last position. | | int | skip​(int length) | Deprecated.

Like ExtractorInput.read(byte[], int, int), except the data is skipped instead of read. | | void | skipFully​(int length) | Deprecated.

Like ExtractorInput.readFully(byte[], int, int), except the data is skipped instead of read. | | boolean | skipFully​(int length, boolean allowEndOfInput) | Deprecated.

Like ExtractorInput.readFully(byte[], int, int, boolean), except the data is skipped instead of read. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

ForwardingExtractorInput

public ForwardingExtractorInput​([ExtractorInput](ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")input)

Deprecated.

Method Detail

- 

read

public int read​(byte[] buffer,
                int offset,
                int length)
         throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Reads up to length bytes from the input and resets the peek position.

This method blocks until at least one byte of data can be read, the end of the input is detected, or an exception is thrown.

Specified by:read in interface DataReaderSpecified by:read in interface ExtractorInputParameters:buffer - A target array into which data should be written.offset - The offset into the target array at which to write.length - The maximum number of bytes to read from the input.Returns:The number of bytes read, or C.RESULT_END_OF_INPUT if the input has ended.Throws:IOException - If an error occurs reading from the input.

- 

readFully

public boolean readFully​(byte[] target,
                         int offset,
                         int length,
                         boolean allowEndOfInput)
                  throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Like ExtractorInput.read(byte[], int, int), but reads the requested length in full. Specified by:readFully in interface ExtractorInputParameters:target - A target array into which data should be written.offset - The offset into the target array at which to write.length - The number of bytes to read from the input.allowEndOfInput - True if encountering the end of the input having read no data is allowed, and should result in false being returned. False if it should be considered an error, causing an EOFException to be thrown. See note in class Javadoc.Returns:True if the read was successful. False if allowEndOfInput=true and the end of the input was encountered having read no data.Throws:EOFException - If the end of input was encountered having partially satisfied the read (i.e. having read at least one byte, but fewer than length), or if no bytes were read and allowEndOfInput is false.IOException - If an error occurs reading from the input.

- 

readFully

public void readFully​(byte[] target,
                      int offset,
                      int length)
               throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Equivalent to readFully(target, offset, length, false). Specified by:readFully in interface ExtractorInputParameters:target - A target array into which data should be written.offset - The offset into the target array at which to write.length - The number of bytes to read from the input.Throws:EOFException - If the end of input was encountered.IOException - If an error occurs reading from the input.

- 

skip

public int skip​(int length)
         throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Like ExtractorInput.read(byte[], int, int), except the data is skipped instead of read. Specified by:skip in interface ExtractorInputParameters:length - The maximum number of bytes to skip from the input.Returns:The number of bytes skipped, or C.RESULT_END_OF_INPUT if the input has ended.Throws:IOException - If an error occurs reading from the input.

- 

skipFully

public boolean skipFully​(int length,
                         boolean allowEndOfInput)
                  throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Like ExtractorInput.readFully(byte[], int, int, boolean), except the data is skipped instead of read. Specified by:skipFully in interface ExtractorInputParameters:length - The number of bytes to skip from the input.allowEndOfInput - True if encountering the end of the input having skipped no data is allowed, and should result in false being returned. False if it should be considered an error, causing an EOFException to be thrown. See note in class Javadoc.Returns:True if the skip was successful. False if allowEndOfInput=true and the end of the input was encountered having skipped no data.Throws:EOFException - If the end of input was encountered having partially satisfied the skip (i.e. having skipped at least one byte, but fewer than length), or if no bytes were skipped and allowEndOfInput is false.IOException - If an error occurs reading from the input.

- 

skipFully

public void skipFully​(int length)
               throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Like ExtractorInput.readFully(byte[], int, int), except the data is skipped instead of read.

Encountering the end of input is always considered an error, and will result in an EOFException being thrown.

Specified by:skipFully in interface ExtractorInputParameters:length - The number of bytes to skip from the input.Throws:EOFException - If the end of input was encountered.IOException - If an error occurs reading from the input.

- 

peek

public int peek​(byte[] target,
                int offset,
                int length)
         throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Peeks up to length bytes from the peek position. The current read position is left unchanged.

This method blocks until at least one byte of data can be peeked, the end of the input is detected, or an exception is thrown.

Calling ExtractorInput.resetPeekPosition() resets the peek position to equal the current read position, so the caller can peek the same data again. Reading or skipping also resets the peek position.

Specified by:peek in interface ExtractorInputParameters:target - A target array into which data should be written.offset - The offset into the target array at which to write.length - The maximum number of bytes to peek from the input.Returns:The number of bytes peeked, or C.RESULT_END_OF_INPUT if the input has ended.Throws:IOException - If an error occurs peeking from the input.

- 

peekFully

public boolean peekFully​(byte[] target,
                         int offset,
                         int length,
                         boolean allowEndOfInput)
                  throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Like ExtractorInput.peek(byte[], int, int), but peeks the requested length in full. Specified by:peekFully in interface ExtractorInputParameters:target - A target array into which data should be written.offset - The offset into the target array at which to write.length - The number of bytes to peek from the input.allowEndOfInput - True if encountering the end of the input having peeked no data is allowed, and should result in false being returned. False if it should be considered an error, causing an EOFException to be thrown. See note in class Javadoc.Returns:True if the peek was successful. False if allowEndOfInput=true and the end of the input was encountered having peeked no data.Throws:EOFException - If the end of input was encountered having partially satisfied the peek (i.e. having peeked at least one byte, but fewer than length), or if no bytes were peeked and allowEndOfInput is false.IOException - If an error occurs peeking from the input.

- 

peekFully

public void peekFully​(byte[] target,
                      int offset,
                      int length)
               throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Equivalent to peekFully(target, offset, length, false). Specified by:peekFully in interface ExtractorInputParameters:target - A target array into which data should be written.offset - The offset into the target array at which to write.length - The number of bytes to peek from the input.Throws:EOFException - If the end of input was encountered.IOException - If an error occurs peeking from the input.

- 

advancePeekPosition

public boolean advancePeekPosition​(int length,
                                   boolean allowEndOfInput)
                            throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Advances the peek position by length bytes. Like ExtractorInput.peekFully(byte[], int, int, boolean) except the data is skipped instead of read. Specified by:advancePeekPosition in interface ExtractorInputParameters:length - The number of bytes by which to advance the peek position.allowEndOfInput - True if encountering the end of the input before advancing is allowed, and should result in false being returned. False if it should be considered an error, causing an EOFException to be thrown. See note in class Javadoc.Returns:True if advancing the peek position was successful. False if allowEndOfInput=true and the end of the input was encountered before advancing over any data.Throws:EOFException - If the end of input was encountered having partially advanced (i.e. having advanced by at least one byte, but fewer than length), or if the end of input was encountered before advancing and allowEndOfInput is false.IOException - If an error occurs advancing the peek position.

- 

advancePeekPosition

public void advancePeekPosition​(int length)
                         throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: ExtractorInput

Advances the peek position by length bytes. Like ExtractorInput.peekFully(byte[], int, int) except the data is skipped instead of read. Specified by:advancePeekPosition in interface ExtractorInputParameters:length - The number of bytes to peek from the input.Throws:EOFException - If the end of input was encountered.IOException - If an error occurs peeking from the input.

- 

resetPeekPosition

public void resetPeekPosition()

Deprecated.

Description copied from interface: ExtractorInput

Resets the peek position to equal the current read position. Specified by:resetPeekPosition in interface ExtractorInput

- 

getPeekPosition

public long getPeekPosition()

Deprecated.

Description copied from interface: ExtractorInput

Returns the current peek position (byte offset) in the stream. Specified by:getPeekPosition in interface ExtractorInputReturns:The peek position (byte offset) in the stream.

- 

getPosition

public long getPosition()

Deprecated.

Description copied from interface: ExtractorInput

Returns the current read position (byte offset) in the stream. Specified by:getPosition in interface ExtractorInputReturns:The read position (byte offset) in the stream.

- 

getLength

public long getLength()

Deprecated.

Description copied from interface: ExtractorInput

Returns the length of the source stream, or C.LENGTH_UNSET if it is unknown. Specified by:getLength in interface ExtractorInputReturns:The length of the source stream, or C.LENGTH_UNSET.

- 

setRetryPosition

public <E extends[Throwable](https://developer.android.com/reference/java/lang/Throwable.html "class or interface in java.lang")> void setRetryPosition​(long position,
                                                   E e)
                                            throws E extends[Throwable](https://developer.android.com/reference/java/lang/Throwable.html "class or interface in java.lang")

Deprecated.

Description copied from interface: ExtractorInput

Called when reading fails and the required retry position is different from the last position. After setting the retry position it throws the given Throwable. Specified by:setRetryPosition in interface ExtractorInputType Parameters:E - Type of Throwable to be thrown.Parameters:position - The required retry position.e - Throwable to be thrown.Throws:E - The given Throwable object.E extends Throwable