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.ADataSink
for 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 void
close()
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.void
open(DataSpec dataSpec)
Deprecated.Opens the sink to consume the specified data.void
write(byte[] buffer, int offset, int length)
Deprecated.Consumes the provided data.
-
-
-
Method Detail
-
open
public void open(DataSpec dataSpec)
Deprecated.Description copied from interface:DataSink
Opens the sink to consume the specified data.Note: If an
IOException
is thrown, callers must still callDataSink.close()
to ensure that any partial effects of the invocation are cleaned up.
-
close
public void close() throws IOException
Deprecated.Description copied from interface:DataSink
Closes 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:
close
in 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:DataSink
Consumes 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.
-
-