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.IOException
public NonBlockingOutput(java.nio.channels.Pipe pipe) throws java.io.IOException
pipe
- Pipe to send output tojava.io.IOException
public NonBlockingOutput(java.lang.String name) throws java.io.IOException
name
- Name of file to store data injava.io.IOException
public void write(int data) throws java.io.IOException
java.io.IOException
public void write(byte[] data) throws java.io.IOException
java.io.IOException
public void write(byte[] data, int offset, int length) throws java.io.IOException
java.io.IOException
protected void clearWriteWaiting()
public void flush()
public void close() throws java.io.IOException
java.io.IOException