SeekableMuxerOutput
@UnstableApi
public interface SeekableMuxerOutput extends WritableByteChannel
FileOutputStreamSeekableMuxerOutput |
An implementation of |
A seekable target for Muxer output.
Summary
Public methods |
|
|---|---|
abstract long |
Returns the current position in the output. |
abstract long |
getSize()Returns the total size of the output. |
default static SeekableMuxerOutput |
of(FileOutputStream fileOutputStream)Creates a |
default static SeekableMuxerOutput |
Creates a |
abstract void |
setPosition(long position)Sets the current position in the output for subsequent |
abstract void |
truncate(long size)Truncates the output to the specified size. |
Inherited methods |
||
|---|---|---|
|
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. |