com.sun.grizzly.filter
Class ProtocolOutputStream
java.lang.Object
java.io.OutputStream
com.sun.grizzly.filter.ProtocolOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public abstract class ProtocolOutputStream
- extends java.io.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.io.OutputStream |
write |
| 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,
java.lang.Integer requestId,
java.lang.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(java.nio.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 java.io.IOException
- Specified by:
write in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
write in class java.io.OutputStream
- Throws:
java.io.IOException
getRequestId
public java.lang.Integer getRequestId()
flush
public void flush()
throws java.io.IOException
- Specified by:
flush in interface java.io.Flushable- Overrides:
flush in class java.io.OutputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.OutputStream
- Throws:
java.io.IOException
Copyright © 2011 Oracle Corporation. All Rights Reserved.