BufferedWriter class final

Wraps a writer and buffers its output.

It can be excessively inefficient to work directly with something that implements Writer. For example, every call to write on a network socket results in a sytem call. A BufferedWriter keeps an in-memory buffer of data and writes to to an underlying writer in larger batches.

BufferedWriter can improve the speed of programs that make small and repeated write calls to the same file or network socket, but will have no effect on programs that write large chunks of data at once or just writing a few times, or to writing to an in-memory buffer.

Implemented types

Constructors

BufferedWriter(Writer _writer, {int capacity = 8 * 1024})
Creates a new buffered writer with the provided capacity.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

flush() Future<void>
Flushes the buffer, ensuring all written data is actually written.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
write(List<int> bytes, [int offset = 0, int? length]) int
Writes the provided bytes to the sink, optionally with offsets.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited