public class ChunkedOutputStream extends PrintStream
Constructor and Description |
---|
ChunkedOutputStream(PrintStream o) |
ChunkedOutputStream(PrintStream o,
int size) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkError()
Flushes the stream and checks its error state.
|
void |
close()
Closes the stream.
|
void |
flush()
Flushes the stream.
|
void |
reset() |
int |
size() |
void |
write(byte[] b,
int off,
int len)
Writes
len bytes from the specified byte array starting at offset off
to this stream. |
void |
write(int _b)
Writes the specified byte to this stream.
|
append, append, append, clearError, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, setError
write
public ChunkedOutputStream(PrintStream o)
public ChunkedOutputStream(PrintStream o, int size)
public boolean checkError()
PrintStream
true
when the underlying output stream throws an IOException
other than
InterruptedIOException
, and when the setError
method is invoked. If an
operation on the underlying output stream throws an InterruptedIOException
, then the
PrintStream
converts the exception back into an interrupt by doing:
Thread.currentThread().interrupt();or the equivalent.
checkError
in class PrintStream
true
if and only if this stream has encountered an IOException
other than InterruptedIOException
, or the setError
method has
been invokedpublic void close()
PrintStream
close
in interface Closeable
close
in interface AutoCloseable
close
in class PrintStream
OutputStream.close()
public void flush()
PrintStream
flush
in interface Flushable
flush
in class PrintStream
OutputStream.flush()
public void reset()
public int size()
public void write(byte[] b, int off, int len)
PrintStream
len
bytes from the specified byte array starting at offset off
to this stream. If automatic flushing is enabled then the flush
method will be
invoked.
Note that the bytes will be written as given; to write characters that will be translated
according to the platform's default character encoding, use the print(char)
or
println(char)
methods.
write
in class PrintStream
b
- A byte arrayoff
- Offset from which to start taking byteslen
- Number of bytes to writeFilterOutputStream.write(int)
public void write(int _b)
PrintStream
flush
method will be invoked.
Note that the byte is written as given; to write a character that will be translated according to
the platform's default character encoding, use the print(char)
or
println(char)
methods.
write
in class PrintStream
_b
- The byte to be writtenPrintStream.print(char)
,
PrintStream.println(char)