com.sun.grizzly.filter
Class ProtocolOutputStream
java.lang.Object
java.io.OutputStream
com.sun.grizzly.filter.ProtocolOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public abstract class ProtocolOutputStream
- extends OutputStream
A Stream which wraps bytes into an Custom Protocol.
See MessageBase.parseHeader(java.nio.ByteBuffer, int, com.sun.grizzly.filter.ReplyMessageFactory)
for
a dscription of the header layout
- Version:
- 1.0
- Author:
- John Vieten 23.06.2008
Field Summary |
protected byte[] |
buf
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
buf
protected byte[] buf
ProtocolOutputStream
public ProtocolOutputStream(byte messageType,
Integer requestId,
Integer sessionId,
boolean gzip)
- Parameters:
asynWritable
- messageType
- requestId
- sessionId
- gzip
-
ProtocolOutputStream
public ProtocolOutputStream(byte messageType,
boolean gzip)
- Parameters:
asynWritable
- messageType
- gzip
-
setExceptionHandler
public void setExceptionHandler(IOExceptionHandler handler)
write
public abstract void write(ByteBuffer b,
AsyncWriteCallbackHandler callbackHandler)
setApplicationLayerError
public void setApplicationLayerError(boolean applicationLayerError)
setMessageType
public void setMessageType(byte messageType)
setInputStream
public void setInputStream(RemoteInputStream inputStream)
setTrafficListener
public void setTrafficListener(BytesTrafficListener trafficListener)
write
public void write(int b)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write
in class OutputStream
- Throws:
IOException
getRequestId
public Integer getRequestId()
flush
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class OutputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class OutputStream
- Throws:
IOException
Copyright © 2012 Oracle Corporation. All Rights Reserved.