Interface DataSink
-
- All Known Implementing Classes:
AesCipherDataSink,ByteArrayDataSink,CacheDataSink,FailOnCloseDataSink
@Deprecated public interface 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.A component to which streams of data can be written.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceDataSink.FactoryDeprecated.A factory forDataSinkinstances.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.Closes the sink.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
void open(DataSpec dataSpec) throws IOException
Deprecated.Opens the sink to consume the specified data.Note: If an
IOExceptionis thrown, callers must still callclose()to ensure that any partial effects of the invocation are cleaned up.- Parameters:
dataSpec- Defines the data to be consumed.- Throws:
IOException- If an error occurs opening the sink.
-
write
void write(byte[] buffer, int offset, int length) throws IOExceptionDeprecated.Consumes the provided data.- Parameters:
buffer- The buffer from which data should be consumed.offset- The offset of the data to consume inbuffer.length- The length of the data to consume, in bytes.- Throws:
IOException- If an error occurs writing to the sink.
-
close
void close() throws IOExceptionDeprecated.Closes the sink.Note: This method must be called even if the corresponding call to
open(DataSpec)threw anIOException. Seeopen(DataSpec)for more details.- Throws:
IOException- If an error occurs closing the sink.
-
-