Java OutputStream Class

Category: Java   Tags: Java, Java File Handling, Java Byte Stream Class, Java OutputStream Class

OutputStream is an abstract class that defines streaming byte output. OutputStream has this declaration:

                                    public abstract class OutputStream
                                    extends Object
                                    implements Closeable, Flushable
                                

Methods

public void write(int b) throws IOException
Writes the specified byte to this file output stream.
public void write(byte[] b) throws IOException
Writes b.length bytes from the specified byte array to this file output stream.
public void write(byte[] b, int offset, int numberOfBytes) throws IOException
Writes numberOfBytes bytes from the specified byte array starting at offset to this file output stream.
public void flush() throws IOException
Flushes this output stream and forces any buffered output bytes to be written out.
public void close() throws IOException
Closes this file output stream and releases any system resources associated with the stream. Further write attempts will generate an IOException.