truncate method

Future<void> truncate(
  1. int length
)

Truncates the staged output to length bytes.

Implementation

Future<void> truncate(int length) => _synchronized(() async {
  ByteRange(0, length);
  try {
    await _handle.truncate(length);
    _length = length;
  } on FileSystemException catch (error) {
    throw ByteSinkIoException(
      operation: 'truncate staged bytes',
      cause: error,
      location: _staging.path,
    );
  }
});