Class Buffer
java.lang.Object
com.castlabs.sdk.base.subtitles.buffer.Buffer
- Direct Known Subclasses:
DecoderInputBuffer
Base class for buffers with flags.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddFlag(int flag) Adds theflagto this buffer's flags.voidclear()Clears the buffer.final voidclearFlag(int flag) Removes theflagfrom this buffer's flags, if it is set.protected final booleangetFlag(int flag) Returns whether the specified flag has been set on this buffer.final booleanReturns whether theConstants.BUFFER_FLAG_HAS_SUPPLEMENTAL_DATAflag is set.final booleanReturns whether theConstants.BUFFER_FLAG_DECODE_ONLYflag is set.final booleanReturns whether theConstants.BUFFER_FLAG_END_OF_STREAMflag is set.final booleanReturns whether theConstants.BUFFER_FLAG_KEY_FRAMEflag is set.final voidsetFlags(int flags) Replaces this buffer's flags withflags.
-
Constructor Details
-
Buffer
public Buffer()
-
-
Method Details
-
clear
public void clear()Clears the buffer. -
isDecodeOnly
public final boolean isDecodeOnly()Returns whether theConstants.BUFFER_FLAG_DECODE_ONLYflag is set. -
isEndOfStream
public final boolean isEndOfStream()Returns whether theConstants.BUFFER_FLAG_END_OF_STREAMflag is set. -
isKeyFrame
public final boolean isKeyFrame()Returns whether theConstants.BUFFER_FLAG_KEY_FRAMEflag is set. -
hasSupplementalData
public final boolean hasSupplementalData()Returns whether theConstants.BUFFER_FLAG_HAS_SUPPLEMENTAL_DATAflag is set. -
setFlags
Replaces this buffer's flags withflags.- Parameters:
flags- The flags to set, which should be a combination of theC.BUFFER_FLAG_*constants.
-
addFlag
Adds theflagto this buffer's flags.- Parameters:
flag- The flag to add to this buffer's flags, which should be one of theC.BUFFER_FLAG_*constants.
-
clearFlag
Removes theflagfrom this buffer's flags, if it is set.- Parameters:
flag- The flag to remove.
-
getFlag
Returns whether the specified flag has been set on this buffer.- Parameters:
flag- The flag to check.- Returns:
- Whether the flag is set.
-