Known Direct Subclasses
| ByteArrayOutputStream |
ByteArrayOutputStream is a class whose underlying stream is represented by a
byte array. |
| ChunkedOutputStream |
Implements chunked transfer coding. |
| ContentLengthOutputStream |
A stream wrapper that closes itself after a defined number of bytes. |
| 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. |
| IdentityOutputStream |
A stream for writing with an "identity" transport encoding. |
| 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
|
Class Overview
OutputStream is an abstract class for all byte output streams. It provides
basic method implementations for writing bytes to a stream.
Summary
| 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
|
Object
|
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
|
|
boolean
|
equals(Object o)
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
|
|
void
|
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver.
|
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of java.lang.Class which represents the class
of the receiver.
|
|
int
|
hashCode()
Returns an integer hash code for the receiver.
|
|
final
void
|
notify()
Causes one thread which is wait ing on the receiver to be
made ready to run.
|
|
final
void
|
notifyAll()
Causes all threads which are wait ing on the receiver to
be made ready to run.
|
|
String
|
toString()
Returns a string containing a concise, human-readable description of the
receiver.
|
|
final
void
|
wait(long time, int frac)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait(long time)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait()
Causes the thread which sent this message to be made not ready to run
pending some change in the receiver (as indicated by notify
or notifyAll).
|
|
From interface java.io.Closeable
|
abstract
void
|
close()
Close the object and release any system resources it holds.
|
|
From interface java.io.Flushable
|
abstract
void
|
flush()
Flushes the object by writing out any buffered data to the underlying
output.
|
|
Public Constructors
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 |