Methods Summary |
---|
public void | close()Closes this stream. This implementation closes the target stream.
try {
flush();
} catch (IOException e) {
// Ignored
}
/* Make sure we clean up this stream if exception fires */
out.close();
|
public void | flush()Ensures that all pending data is sent out to the target stream. This
implementation flushes the target stream.
out.flush();
|
public void | write(byte[] buffer)Writes the entire contents of the byte array {@code buffer} to this
stream. This implementation writes the {@code buffer} to the target
stream.
// BEGIN android-note
// changed array notation to be consistent with the rest of harmony
// END android-note
write(buffer, 0, buffer.length);
|
public void | write(byte[] buffer, int offset, int count)Writes {@code count} bytes from the byte array {@code buffer} starting at
{@code offset} to the target stream.
// BEGIN android-note
// changed array notation to be consistent with the rest of harmony
// END android-note
// avoid int overflow, force null buffer check first
// BEGIN android-changed
// Exception priorities (in case of multiple errors) differ from
// RI, but are spec-compliant.
// removed redundant check, made implicit null check explicit,
// used (offset | count) < 0 instead of (offset < 0) || (count < 0)
// to safe one operation
if (buffer == null) {
throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
}
if ((offset | count) < 0 || count > buffer.length - offset) {
throw new ArrayIndexOutOfBoundsException(Msg.getString("K002f")); //$NON-NLS-1$
}
// END android-changed
for (int i = 0; i < count; i++) {
// Call write() instead of out.write() since subclasses could
// override the write() method.
write(buffer[offset + i]);
}
|
public void | write(int oneByte)Writes one byte to the target stream. Only the low order byte of the
integer {@code oneByte} is written.
out.write(oneByte);
|