Class ExtractorUtil
- java.lang.Object
-
- com.google.android.exoplayer2.extractor.ExtractorUtil
-
@Deprecated public final class ExtractorUtil extends Object
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.Extractor related utility methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidcheckContainerInput(boolean expression, String message)Deprecated.Ifexpressionis false, throws acontainer malformed ParserExceptionwith the given message.static booleanpeekFullyQuietly(ExtractorInput input, byte[] output, int offset, int length, boolean allowEndOfInput)Deprecated.Peeks data frominput, respectingallowEndOfInput.static intpeekToLength(ExtractorInput input, byte[] target, int offset, int length)Deprecated.Peekslengthbytes from the input peek position, or all the bytes to the end of the input if there was less thanlengthbytes left.static booleanreadFullyQuietly(ExtractorInput input, byte[] output, int offset, int length)Deprecated.Equivalent toExtractorInput.readFully(byte[], int, int)except that it returnsfalseinstead of throwing anEOFExceptionif the end of input is encountered without having fully satisfied the read.static booleanskipFullyQuietly(ExtractorInput input, int length)Deprecated.Equivalent toExtractorInput.skipFully(int)except that it returnsfalseinstead of throwing anEOFExceptionif the end of input is encountered without having fully satisfied the skip.
-
-
-
Method Detail
-
checkContainerInput
@Pure public static void checkContainerInput(boolean expression, @Nullable String message) throws ParserExceptionDeprecated.Ifexpressionis false, throws acontainer malformed ParserExceptionwith the given message. Otherwise, does nothing.- Throws:
ParserException
-
peekToLength
public static int peekToLength(ExtractorInput input, byte[] target, int offset, int length) throws IOException
Deprecated.Peekslengthbytes from the input peek position, or all the bytes to the end of the input if there was less thanlengthbytes left.If an exception is thrown, there is no guarantee on the peek position.
- Parameters:
input- The stream input to peek the data from.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.
- Throws:
IOException- If an error occurs peeking from the input.
-
readFullyQuietly
public static boolean readFullyQuietly(ExtractorInput input, byte[] output, int offset, int length) throws IOException
Deprecated.Equivalent toExtractorInput.readFully(byte[], int, int)except that it returnsfalseinstead of throwing anEOFExceptionif the end of input is encountered without having fully satisfied the read.- Throws:
IOException
-
skipFullyQuietly
public static boolean skipFullyQuietly(ExtractorInput input, int length) throws IOException
Deprecated.Equivalent toExtractorInput.skipFully(int)except that it returnsfalseinstead of throwing anEOFExceptionif the end of input is encountered without having fully satisfied the skip.- Throws:
IOException
-
peekFullyQuietly
public static boolean peekFullyQuietly(ExtractorInput input, byte[] output, int offset, int length, boolean allowEndOfInput) throws IOException
Deprecated.Peeks data frominput, respectingallowEndOfInput. Returns true if the peek is successful.If
allowEndOfInput=falsethen encountering the end of the input (whether before or after reading some data) will throwEOFException.If
allowEndOfInput=truethen encountering the end of the input (even after reading some data) will returnfalse.This is slightly different to the behaviour of
ExtractorInput.peekFully(byte[], int, int, boolean), whereallowEndOfInput=trueonly returns false (and suppresses the exception) if the end of the input is reached before reading any data.- Throws:
IOException
-
-