|
Android 2.3 Gingerbread | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
public abstract class OutputStream
The base class for all output streams. An output stream is a means of writing
data to a target in a byte-wise manner. Most output streams expect the
flush() method to be called before closing the stream, to ensure all
data is actually written through.
This abstract class does not provide a fully working implementation, so it
needs to be subclassed, and at least the write(int) method needs to
be overridden. Overriding some of the non-abstract methods is also often
advised, since it might result in higher efficiency.
Many specialized output streams for purposes like writing to a file already exist in this package.
InputStream| Constructor Summary | |
|---|---|
OutputStream()
Default constructor. |
|
| Method Summary | |
|---|---|
(package private) boolean |
checkError()
Returns true if this writer has encountered and suppressed an error. |
void |
close()
Closes this stream. |
void |
flush()
Flushes this stream. |
void |
write(byte[] buffer)
Writes the entire contents of the byte array buffer to this
stream. |
void |
write(byte[] buffer,
int offset,
int count)
Writes count bytes from the byte array buffer starting at
position offset to this stream. |
abstract void |
write(int oneByte)
Writes a single byte to this stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OutputStream()
| Method Detail |
|---|
public void close()
throws IOException
close in interface CloseableIOException - if an error occurs while closing this stream.
public void flush()
throws IOException
flush in interface FlushableIOException - if an error occurs while flushing this stream.
public void write(byte[] buffer)
throws IOException
buffer to this
stream.
buffer - the buffer to be written.
IOException - if an error occurs while writing to this stream.
public void write(byte[] buffer,
int offset,
int count)
throws IOException
count bytes from the byte array buffer starting at
position offset to this stream.
buffer - the buffer to be written.offset - the start position in buffer from where to get bytes.count - the number of bytes from buffer to write to this
stream.
IOException - if an error occurs while writing to this stream.
IndexOutOfBoundsException - if offset < 0 or count < 0, or if
offset + count is bigger than the length of
buffer.
public abstract void write(int oneByte)
throws IOException
oneByte is written to the stream.
oneByte - the byte to be written.
IOException - if an error occurs while writing to this stream.boolean checkError()
|
Android 2.3 Gingerbread | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||