SeekableMuxerOutput


@UnstableApi
interface SeekableMuxerOutput : WritableByteChannel


A seekable target for Muxer output.

Summary

Public functions

Long

Returns the current position in the output.

Long

Returns the total size of the output.

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.

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.

Public functions

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.

of

java-static fun of(fileOutputStream: FileOutputStream!): SeekableMuxerOutput!

Creates a SeekableMuxerOutput from the given FileOutputStream.

of

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

Creates a SeekableMuxerOutput from the given file path.

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.