org.apache.activemq.transport.nio
public class NIOOutputStream extends java.io.OutputStream implements TimeStampStream
Constructor and Description |
---|
NIOOutputStream(java.nio.channels.WritableByteChannel out)
Constructor
|
NIOOutputStream(java.nio.channels.WritableByteChannel out,
int size)
Creates a new buffered output stream to write data to the specified
underlying output stream with the specified buffer size.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkClosed()
Checks that the stream has not been closed
|
void |
close()
close this stream
|
void |
flush()
flush the data to the output stream This doesn't call flush on the
underlying outputstream, because Tcp is particularly efficent at doing
this itself ....
|
long |
getWriteTimestamp() |
boolean |
isWriting() |
void |
setEngine(javax.net.ssl.SSLEngine engine) |
void |
write(byte[] b,
int off,
int len)
write a byte array to the stream
|
protected void |
write(java.nio.ByteBuffer data) |
void |
write(int b)
write a byte on to the stream
|
public NIOOutputStream(java.nio.channels.WritableByteChannel out)
out
- public NIOOutputStream(java.nio.channels.WritableByteChannel out, int size)
out
- the underlying output stream.size
- the buffer size.java.lang.IllegalArgumentException
- if size <= 0.public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- - byte to writejava.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
b
- the byte bufferoff
- the offset into the bufferlen
- the length of data to writejava.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
protected void checkClosed() throws java.io.IOException
java.io.IOException
protected void write(java.nio.ByteBuffer data) throws java.io.IOException
java.io.IOException
public boolean isWriting()
isWriting
in interface TimeStampStream
public long getWriteTimestamp()
getWriteTimestamp
in interface TimeStampStream
public void setEngine(javax.net.ssl.SSLEngine engine)
Copyright © 2005-2014. All Rights Reserved.