加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090223075055/http://developer.android.com:80/reference/java/io/OutputStream.html
public abstract class

OutputStream

extends Object
implements Closeable Flushable
java.lang.Object
   ↳ java.io.OutputStream
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

OutputStream is an abstract class for all byte output streams. It provides basic method implementations for writing bytes to a stream.

See Also

Summary

Public Constructors
OutputStream()
Default constructor.
Public Methods
void close()
Close this OutputStream.
void flush()
Flush this OutputStream.
void write(byte[] buffer)
Writes the entire contents of the byte array buffer to this OutputStream.
abstract void write(int oneByte)
Writes the specified byte oneByte to this OutputStream.
void write(byte[] buffer, int offset, int count)
Writes count bytes from the byte array buffer starting at offset to this OutputStream.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable

Public Constructors

public OutputStream ()

Default constructor.

Public Methods

public void close ()

Close this OutputStream. Concrete implementations of this class should free any resources during close. This implementation does nothing.

Throws
IOException If an error occurs attempting to close this OutputStream.

public void flush ()

Flush this OutputStream. Concrete implementations of this class should ensure any pending writes to the underlying stream are written out when this method is envoked. This implementation does nothing.

Throws
IOException If an error occurs attempting to flush this OutputStream.

public void write (byte[] buffer)

Writes the entire contents of the byte array buffer to this OutputStream.

Parameters
buffer the buffer to be written
Throws
IOException If an error occurs attempting to write to this OutputStream.

public abstract void write (int oneByte)

Writes the specified byte oneByte to this OutputStream. Only the low order byte of oneByte is written.

Parameters
oneByte the byte to be written
Throws
IOException If an error occurs attempting to write to this OutputStream.

public void write (byte[] buffer, int offset, int count)

Writes count bytes from the byte array buffer starting at offset to this OutputStream.

Parameters
buffer the buffer to be written
offset offset in buffer to get bytes
count number of bytes in buffer to write
Throws
IOException If an error occurs attempting to write to this OutputStream.
IndexOutOfBoundsException If offset or count are outside of bounds.