|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.exist.storage.io.BlockingOutputStream
public class BlockingOutputStream
Output stream adapter for a BlockingInputStream.
Constructor Summary | |
---|---|
BlockingOutputStream(BlockingInputStream stream)
Create a new BlockingOutputStream adapter. |
Method Summary | |
---|---|
void |
close()
Closes this output stream. |
void |
close(Exception ex)
Closes this output stream, specifying that an exception has occurred. |
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out. |
BlockingInputStream |
getInputStream()
BlockingInputStream of this BlockingOutputStream. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array
starting at offset off to this output stream. |
void |
write(int b)
Writes the specified byte to this output stream. |
Methods inherited from class java.io.OutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlockingOutputStream(BlockingInputStream stream)
stream
- The BlockingInputStream to adapt.Method Detail |
---|
public BlockingInputStream getInputStream()
public void write(int b) throws IOException
write
is that one byte is written
to the output stream. The byte to be written is the eight
low-order bits of the argument b
. The 24
high-order bits of b
are ignored.
write
in class OutputStream
b
- the byte
.
ExistIOException
- if an I/O error occurs. In particular,
an ExistIOException
may be thrown if the
output stream has been closed.
IOException
public void write(byte[] b, int off, int len) throws IOException
len
bytes from the specified byte array
starting at offset off
to this output stream.
The general contract for write(b, off, len)
is that
some of the bytes in the array b
are written to the
output stream in order; element b[off]
is the first
byte written and b[off+len-1]
is the last byte written
by this operation.
write
in class OutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.
IOException
- if an I/O error occurs. In particular,
an IOException
is thrown if the output
stream is closed.public void close() throws IOException
This method blocks its caller until the corresponding input stream is closed or an exception occurs.
close
in interface Closeable
close
in class OutputStream
IOException
- if an I/O error occurs.public void close(Exception ex) throws IOException
BlockingInputStream
specific method.
IOException
- if an I/O error occurs.public void flush() throws IOException
This methods blocks its caller until all buffered bytes are actually read by the consuming threads.
flush
in interface Flushable
flush
in class OutputStream
IOException
- if an I/O error occurs.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |