remainingBufferSpace property

int get remainingBufferSpace

Returns the remaining space in the buffer.

Returns

The number of bytes that can be written to the buffer before it needs to be flushed.

Example

final buffered = BufferedOutputStream(FileOutputStream('output.bin'));
print('Buffer space: ${buffered.remainingBufferSpace}'); // 8192

await buffered.writeByte(65);
print('Buffer space: ${buffered.remainingBufferSpace}'); // 8191

Implementation

int get remainingBufferSpace => _buffer.length - _count;