java.io · java.base · since Java 1.0

OutputStream

declaration
public abstract class OutputStream implements Closeable, Flushable

The abstract byte sink. Buffer it, write, flush before checking results, close via try-with-resources (which flushes).

Key methods

void write(int b) / write(byte[] b, int off, int len)Byte and block writes.
void flush()Push buffered bytes down the chain.