# PrintStream class abstract

An abstract interface representing a stream for formatted text output.

This is analogous to Java’s `PrintStream`, and provides utility methods for printing values with or without newlines, flushing buffered content, and closing the stream.

Implementations of this interface can print to `stdout`, files, memory, or any other sink that supports basic text streaming.

### 📦 Example Usage:

    class ConsolePrintStream implements PrintStream {
      @override
      void print(Object? obj) => stdout.print(obj ?? 'null');

      @override
      void println(Object? obj) => stdout.println(obj ?? 'null');

      @override
      void newline() => stdout.println();

      @override
      void flush() {} // No-op for stdout

      @override
      Future<void> close() async {} // Nothing to close
    }

    final stream = ConsolePrintStream();
    stream.print('Hello');
    stream.println(' World');
    stream.newline();
    await stream.close();

## Constructors

PrintStream.new()

## Properties

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

## Methods

close() → Future<void>
  An abstract interface representing a stream for formatted text output.
flush() → void
  An abstract interface representing a stream for formatted text output.
newline() → void
  An abstract interface representing a stream for formatted text output.
noSuchMethod(Invocation invocation) → dynamic
  Invoked when a nonexistent method or property is accessed.
  inherited
print(Object? obj) → void
  An abstract interface representing a stream for formatted text output.
println([Object? obj]) → void
  An abstract interface representing a stream for formatted text output.
toString() → String
  A string representation of this object.
  inherited

## Operators

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