java.io
public
abstract
class
java.io.OutputStream
OutputStream is an abstract class for all byte output streams. It provides
basic method implementations for writing bytes to a stream.
Known Direct Subclasses
ByteArrayOutputStream |
ByteArrayOutputStream is a class whose underlying stream is represented by a
byte array. |
FileOutputStream |
FileOutputStream is a class whose underlying stream is represented by a file
in the operating system. |
FilterOutputStream |
FilteredOutputStream is a class which takes an output stream and
filters the output in some way. |
ObjectOutputStream |
An ObjectOutputStream can be used to save Java objects into a stream where
the objects can be loaded later with an ObjectInputStream. |
PipedOutputStream |
PipedOutputStream is a class which places information on a communications
pipe. |
Known Indirect Subclasses
BufferedOutputStream,
CheckedOutputStream,
CipherOutputStream,
DataOutputStream,
DeflaterOutputStream,
DigestOutputStream,
GZIPOutputStream,
JarOutputStream,
ParcelFileDescriptor.AutoCloseOutputStream,
PrintStream,
ZipOutputStream
Summary
Public Constructors
Public Methods
|
|
|
|
|
void |
close() |
|
|
|
|
|
void |
flush() |
|
|
|
|
|
void |
write(byte[] buffer) |
abstract |
|
|
|
|
void |
write(int oneByte) |
|
|
|
|
|
void |
write(byte[] buffer, int offset, int count) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
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 |