com.mindbright.nio
public class NonBlockingOutput extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
|
NonBlockingOutput(java.nio.channels.Pipe pipe)
Creates a new NonBlockingOutput object which sends any output
to a pipe.
|
|
NonBlockingOutput(java.lang.String name)
Creates a new NonBlockingOutput object which sends any output
to a file.
|
protected |
NonBlockingOutput(Switchboard switchboard,
java.nio.channels.spi.AbstractInterruptibleChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearWriteWaiting() |
void |
close()
Close the underlying stream.
|
void |
flush()
Tries to flush any bytes to the underlying stream
|
void |
write(byte[] data)
Writes all the bytes in the provided buffer to the stream
|
void |
write(byte[] data,
int offset,
int length)
Writes the indicated part of the buffer to the stream
|
void |
write(int data)
Writes the specified byte
|
protected NonBlockingOutput(Switchboard switchboard, java.nio.channels.spi.AbstractInterruptibleChannel channel) throws java.io.IOException
java.io.IOExceptionpublic NonBlockingOutput(java.nio.channels.Pipe pipe)
throws java.io.IOException
pipe - Pipe to send output tojava.io.IOExceptionpublic NonBlockingOutput(java.lang.String name)
throws java.io.IOException
name - Name of file to store data injava.io.IOExceptionpublic void write(int data)
throws java.io.IOException
java.io.IOExceptionpublic void write(byte[] data)
throws java.io.IOException
java.io.IOExceptionpublic void write(byte[] data,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionprotected void clearWriteWaiting()
public void flush()
public void close()
throws java.io.IOException
java.io.IOException