Class ByteArrayDataSink
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.ByteArrayDataSink
-
- All Implemented Interfaces:
DataSink
@Deprecated public final class ByteArrayDataSink extends Object implements DataSink
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.ADataSinkfor writing to a byte array.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.upstream.DataSink
DataSink.Factory
-
-
Constructor Summary
Constructors Constructor Description ByteArrayDataSink()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.Closes the sink.byte[]getData()Deprecated.Returns the data written to the sink since the last call toopen(DataSpec), or null ifopen(DataSpec)has never been called.voidopen(DataSpec dataSpec)Deprecated.Opens the sink to consume the specified data.voidwrite(byte[] buffer, int offset, int length)Deprecated.Consumes the provided data.
-
-
-
Method Detail
-
open
public void open(DataSpec dataSpec)
Deprecated.Description copied from interface:DataSinkOpens the sink to consume the specified data.Note: If an
IOExceptionis thrown, callers must still callDataSink.close()to ensure that any partial effects of the invocation are cleaned up.
-
close
public void close() throws IOExceptionDeprecated.Description copied from interface:DataSinkCloses the sink.Note: This method must be called even if the corresponding call to
DataSink.open(DataSpec)threw anIOException. SeeDataSink.open(DataSpec)for more details.- Specified by:
closein interfaceDataSink- Throws:
IOException- If an error occurs closing the sink.
-
write
public void write(byte[] buffer, int offset, int length)Deprecated.Description copied from interface:DataSinkConsumes the provided data.
-
getData
@Nullable public byte[] getData()
Deprecated.Returns the data written to the sink since the last call toopen(DataSpec), or null ifopen(DataSpec)has never been called.
-
-