Class 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.
    A DataSink for writing to a byte array.
    • Constructor Detail

      • ByteArrayDataSink

        public ByteArrayDataSink()
        Deprecated.
    • 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 call DataSink.close() to ensure that any partial effects of the invocation are cleaned up.

        Specified by:
        open in interface DataSink
        Parameters:
        dataSpec - Defines the data to be consumed.
      • write

        public void write​(byte[] buffer,
                          int offset,
                          int length)
        Deprecated.
        Description copied from interface: DataSink
        Consumes the provided data.
        Specified by:
        write in interface DataSink
        Parameters:
        buffer - The buffer from which data should be consumed.
        offset - The offset of the data to consume in buffer.
        length - The length of the data to consume, in bytes.
      • getData

        @Nullable
        public byte[] getData()
        Deprecated.
        Returns the data written to the sink since the last call to open(DataSpec), or null if open(DataSpec) has never been called.