ParserException


@UnstableApi
public class ParserException extends IOException

Known direct subclasses
SsManifestParser.MissingFieldException

Thrown if a required field is missing.

UnrecognizedInputFormatException

Thrown if the input format was not recognized.


Thrown when an error occurs parsing media data and metadata.

Summary

Public fields

final boolean

Whether the parsing error was caused by a bitstream not following the expected format.

final int

The data type of the parsed bitstream.

Protected constructors

ParserException(
    @Nullable String message,
    @Nullable Throwable cause,
    boolean contentIsMalformed,
    @C.DataType int dataType
)

Public methods

static ParserException
createForMalformedContainer(
    @Nullable String message,
    @Nullable Throwable cause
)

Creates a new instance for which contentIsMalformed is true and dataType is DATA_TYPE_MEDIA.

static ParserException

Creates a new instance for which contentIsMalformed is true and dataType is DATA_TYPE_UNKNOWN.

static ParserException
createForMalformedManifest(
    @Nullable String message,
    @Nullable Throwable cause
)

Creates a new instance for which contentIsMalformed is true and dataType is DATA_TYPE_MANIFEST.

static ParserException

Creates a new instance for which contentIsMalformed is false and dataType is DATA_TYPE_MANIFEST.

static ParserException

Creates a new instance for which contentIsMalformed is false and dataType is DATA_TYPE_MEDIA.

@Nullable String

Inherited methods

From java.lang.Throwable
synchronized final void
synchronized Throwable
synchronized Throwable
String
StackTraceElement[]
synchronized final Throwable[]
synchronized Throwable
void
void
setStackTrace(StackTraceElement[] stackTrace)
String

Public fields

contentIsMalformed

public final boolean contentIsMalformed

Whether the parsing error was caused by a bitstream not following the expected format. May be false when a parser encounters a legal condition which it does not support.

dataType

public final int dataType

The data type of the parsed bitstream.

Protected constructors

ParserException

protected ParserException(
    @Nullable String message,
    @Nullable Throwable cause,
    boolean contentIsMalformed,
    @C.DataType int dataType
)

Public methods

createForMalformedContainer

public static ParserException createForMalformedContainer(
    @Nullable String message,
    @Nullable Throwable cause
)

Creates a new instance for which contentIsMalformed is true and dataType is DATA_TYPE_MEDIA.

Parameters
@Nullable String message

See getMessage.

@Nullable Throwable cause

See getCause.

Returns
ParserException

The created instance.

createForMalformedDataOfUnknownType

public static ParserException createForMalformedDataOfUnknownType(
    @Nullable String message,
    @Nullable Throwable cause
)

Creates a new instance for which contentIsMalformed is true and dataType is DATA_TYPE_UNKNOWN.

Parameters
@Nullable String message

See getMessage.

@Nullable Throwable cause

See getCause.

Returns
ParserException

The created instance.

createForMalformedManifest

public static ParserException createForMalformedManifest(
    @Nullable String message,
    @Nullable Throwable cause
)

Creates a new instance for which contentIsMalformed is true and dataType is DATA_TYPE_MANIFEST.

Parameters
@Nullable String message

See getMessage.

@Nullable Throwable cause

See getCause.

Returns
ParserException

The created instance.

createForManifestWithUnsupportedFeature

public static ParserException createForManifestWithUnsupportedFeature(
    @Nullable String message,
    @Nullable Throwable cause
)

Creates a new instance for which contentIsMalformed is false and dataType is DATA_TYPE_MANIFEST.

Parameters
@Nullable String message

See getMessage.

@Nullable Throwable cause

See getCause.

Returns
ParserException

The created instance.

createForUnsupportedContainerFeature

public static ParserException createForUnsupportedContainerFeature(@Nullable String message)

Creates a new instance for which contentIsMalformed is false and dataType is DATA_TYPE_MEDIA.

Parameters
@Nullable String message

See getMessage.

Returns
ParserException

The created instance.

getMessage

public @Nullable String getMessage()