org.fusesource.fabric.dosgi.tcp
Class LengthPrefixedCodec
java.lang.Object
org.fusesource.fabric.dosgi.tcp.LengthPrefixedCodec
- All Implemented Interfaces:
- ProtocolCodec
public class LengthPrefixedCodec
- extends java.lang.Object
- implements ProtocolCodec
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LengthPrefixedCodec
public LengthPrefixedCodec()
full
public boolean full()
- Specified by:
full in interface ProtocolCodec
- Returns:
- true if the codec will no accept any more writes.
empty
protected boolean empty()
setWritableByteChannel
public void setWritableByteChannel(java.nio.channels.WritableByteChannel channel)
- Specified by:
setWritableByteChannel in interface ProtocolCodec
write
public ProtocolCodec.BufferState write(java.lang.Object value)
throws java.io.IOException
- Description copied from interface:
ProtocolCodec
- Non-blocking channel based encoding.
- Specified by:
write in interface ProtocolCodec
- Returns:
- true if the write completed.
- Throws:
java.io.IOException
flush
public ProtocolCodec.BufferState flush()
throws java.io.IOException
- Description copied from interface:
ProtocolCodec
- Attempts to complete the previous write which did not complete.
- Specified by:
flush in interface ProtocolCodec
- Returns:
-
- Throws:
java.io.IOException
getWriteCounter
public long getWriteCounter()
- Specified by:
getWriteCounter in interface ProtocolCodec
- Returns:
- The number of bytes written.
setReadableByteChannel
public void setReadableByteChannel(java.nio.channels.ReadableByteChannel channel)
- Specified by:
setReadableByteChannel in interface ProtocolCodec
read
public java.lang.Object read()
throws java.io.IOException
- Description copied from interface:
ProtocolCodec
- Non-blocking channel based decoding.
- Specified by:
read in interface ProtocolCodec
- Returns:
-
- Throws:
java.io.IOException
getReadCounter
public long getReadCounter()
- Specified by:
getReadCounter in interface ProtocolCodec
- Returns:
- The number of bytes received.
Copyright © 2013 Red Hat. All Rights Reserved.