import org.apache.sshd.common.io.IoOutputStream;
import org.apache.sshd.common.io.IoWriteFuture;
import org.apache.sshd.common.io.WritePendingException;
-import org.apache.sshd.common.util.buffer.Buffer;
-import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
+import org.apache.sshd.common.util.Buffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
private static Buffer toBuffer(final ByteBuf msg) {
- // FIXME: Translation from ByteBuf to Buffer. Buffer is an abstract class, so based on the assumptions
- // we can make about the contents of ByteBuf, we should be able to skip copying byte arrays around
- // by creating an appropriate subclass.
-
+ // TODO Buffer vs ByteBuf translate, Can we handle that better ?
msg.resetReaderIndex();
final byte[] temp = new byte[msg.readableBytes()];
msg.readBytes(temp, 0, msg.readableBytes());
- return new ByteArrayBuffer(temp);
+ return new Buffer(temp);
}
private static final class PendingWriteRequest {