FileOutputStreamSeekableMuxerOutput


@UnstableApi
class FileOutputStreamSeekableMuxerOutput : SeekableMuxerOutput


An implementation of SeekableMuxerOutput that writes to a FileOutputStream.

Summary

Public constructors

Creates an instance.

Public functions

Unit
Long

Returns the current position in the output.

Long

Returns the total size of the output.

Boolean
Unit
setPosition(position: Long)

Sets the current position in the output for subsequent write operations.

Unit
truncate(size: Long)

Truncates the output to the specified size.

Int

Inherited functions

From androidx.media3.muxer.SeekableMuxerOutput
java-static SeekableMuxerOutput!
of(fileOutputStream: FileOutputStream!)

Creates a SeekableMuxerOutput from the given FileOutputStream.

java-static SeekableMuxerOutput!
of(filePath: String!)

Creates a SeekableMuxerOutput from the given file path.

Public constructors

FileOutputStreamSeekableMuxerOutput

FileOutputStreamSeekableMuxerOutput(fileOutputStream: FileOutputStream!)

Creates an instance.

Parameters
fileOutputStream: FileOutputStream!

The FileOutputStream to write output to.

Public functions

close

fun close(): Unit

getPosition

fun getPosition(): Long

Returns the current position in the output.

This refers to the byte offset at which bytes will be written on the next write call.

Returns
Long

The current position in bytes from the beginning of the output.

Throws
java.io.IOException

If an error occurs while getting the position.

getSize

fun getSize(): Long

Returns the total size of the output.

Returns
Long

The total size of the output in bytes.

Throws
java.io.IOException

If an error occurs while getting the size.

isOpen

fun isOpen(): Boolean

setPosition

fun setPosition(position: Long): Unit

Sets the current position in the output for subsequent write operations.

Parameters
position: Long

The new position in bytes from the beginning of the output.

Throws
java.io.IOException

If an error occurs while setting the position.

truncate

fun truncate(size: Long): Unit

Truncates the output to the specified size.

If the current position (for writing) is beyond the new size, it is set to the new size.

Parameters
size: Long

The new size of the output in bytes.

Throws
java.io.IOException

If an error occurs while truncating the output.

write

fun write(src: ByteBuffer!): Int