SeekableMuxerOutput


@UnstableApi
public interface SeekableMuxerOutput extends WritableByteChannel


A seekable target for Muxer output.

Summary

Public methods

abstract long

Returns the current position in the output.

abstract long

Returns the total size of the output.

default static SeekableMuxerOutput
of(FileOutputStream fileOutputStream)

Creates a SeekableMuxerOutput from the given FileOutputStream.

default static SeekableMuxerOutput
of(String filePath)

Creates a SeekableMuxerOutput from the given file path.

abstract void
setPosition(long position)

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

abstract void
truncate(long size)

Truncates the output to the specified size.

Inherited methods

From java.nio.channels.Channel
abstract void
abstract boolean
From java.nio.channels.WritableByteChannel
abstract int

Public methods

getPosition

abstract long getPosition()

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

abstract long getSize()

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

default static SeekableMuxerOutput of(FileOutputStream fileOutputStream)

Creates a SeekableMuxerOutput from the given FileOutputStream.

of

default static SeekableMuxerOutput of(String filePath)

Creates a SeekableMuxerOutput from the given file path.

setPosition

abstract void setPosition(long position)

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

Parameters
long position

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

Throws
java.io.IOException

If an error occurs while setting the position.

truncate

abstract void truncate(long size)

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
long size

The new size of the output in bytes.

Throws
java.io.IOException

If an error occurs while truncating the output.