Package com.pixelmed.dicom
Class AsynchronousOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.pixelmed.dicom.AsynchronousOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
A class that extends FilterOutputStream
by
creating a separate thread to actually perform the output operations, and returning
immediately from write calls, but blocking on closing.
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this output stream and releases any system resources associated with the stream.void
flush()
Flushes this output stream and forces any buffered output bytes to be written out to the stream.void
write
(byte[] b) Writesb.length
bytes to this output stream.void
write
(byte[] b, int off, int len) Writeslen
bytes from the specified byte array starting at offsetoff
to this output stream.void
write
(int b) Writes the specifiedbyte
to this output stream.Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
AsynchronousOutputStream
- Parameters:
out
- theOutputStream
to write to
-
-
Method Details
-
write
Writeslen
bytes from the specified byte array starting at offsetoff
to this output stream.- Overrides:
write
in classFilterOutputStream
- Parameters:
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.- Throws:
IOException
- if an I/O error occurs.
-
write
Writes the specifiedbyte
to this output stream.- Overrides:
write
in classFilterOutputStream
- Parameters:
b
- thebyte
.- Throws:
IOException
- if an I/O error occurs.
-
write
Writesb.length
bytes to this output stream.- Overrides:
write
in classFilterOutputStream
- Parameters:
b
- the data to be written.- Throws:
IOException
- if an I/O error occurs.
-
flush
Flushes this output stream and forces any buffered output bytes to be written out to the stream.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterOutputStream
- Throws:
IOException
- if an I/O error occurs.
-
close
Closes this output stream and releases any system resources associated with the stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
- if an I/O error occurs.
-