diff --git a/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java b/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java index 4d1ef2044a..1342715772 100644 --- a/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java +++ b/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java @@ -222,9 +222,13 @@ final public class ByteBufferPacket implements Packet { if( buffer.hasArray() ) { byte[] bs = buffer.array(); return new ByteSequence(bs, buffer.position(), buffer.remaining()); + } else { + byte[] bs = new byte[buffer.remaining()]; + int p = buffer.position(); + buffer.get(bs); + buffer.position(p); + return new ByteSequence(bs, 0, bs.length); } - // TODO: implement the direct case. - return null; } /**