Crossfire JXClient, Trunk
|
Public Member Functions | |
void | close () throws IOException |
void | flush () throws IOException |
TeeStream (OutputStream outputStream, Path outputFile) throws IOException | |
void | write (int b) throws IOException |
Private Attributes | |
final OutputStream | fileStream |
final OutputStream | outputStream |
Passes the output through to the specified output stream while copying it into a file. The TeeStream functionality is similar to the Unix tee utility. TeeStream implements AutoCloseable interface. See OutputStream for details.
Definition at line 78 of file CustomAutoCloseableSample.java.
CustomAutoCloseableSample.TeeStream.TeeStream | ( | OutputStream | outputStream, |
Path | outputFile | ||
) | throws IOException |
Creates a TeeStream.
outputStream | an output stream. |
outputFile | an path to file. |
IOException | If an I/O error occurs. |
Definition at line 90 of file CustomAutoCloseableSample.java.
References CustomAutoCloseableSample.TeeStream.outputStream.
void CustomAutoCloseableSample.TeeStream.close | ( | ) | throws IOException |
Closes underlying streams and resources. The external output stream won't be closed. This method is the member of AutoCloseable interface and it will be invoked automatically after the try-with-resources block.
IOException | If an I/O error occurs. |
Definition at line 131 of file CustomAutoCloseableSample.java.
References file, CustomAutoCloseableSample.TeeStream.fileStream, and CustomAutoCloseableSample.TeeStream.flush().
void CustomAutoCloseableSample.TeeStream.flush | ( | ) | throws IOException |
Flushes this output stream and forces any buffered output bytes to be written out. The flush
method of TeeStream
flushes the specified output stream and the file output stream.
IOException | if an I/O error occurs. |
Definition at line 117 of file CustomAutoCloseableSample.java.
References CustomAutoCloseableSample.TeeStream.fileStream, and CustomAutoCloseableSample.TeeStream.outputStream.
Referenced by CustomAutoCloseableSample.TeeStream.close().
void CustomAutoCloseableSample.TeeStream.write | ( | int | b | ) | throws IOException |
Writes the specified byte to the specified output stream and copies it to the file.
b | the byte to be written. |
IOException | If an I/O error occurs. |
Definition at line 103 of file CustomAutoCloseableSample.java.
References CustomAutoCloseableSample.TeeStream.fileStream, and CustomAutoCloseableSample.TeeStream.outputStream.
|
private |
Definition at line 80 of file CustomAutoCloseableSample.java.
Referenced by CustomAutoCloseableSample.TeeStream.close(), CustomAutoCloseableSample.TeeStream.flush(), and CustomAutoCloseableSample.TeeStream.write().
|
private |
Definition at line 81 of file CustomAutoCloseableSample.java.
Referenced by CustomAutoCloseableSample.TeeStream.flush(), CustomAutoCloseableSample.TeeStream.TeeStream(), and CustomAutoCloseableSample.TeeStream.write().