Revert "Bump apache mina to 1.2.0"
[netconf.git] / netconf / netconf-netty-util / src / main / java / org / opendaylight / netconf / nettyutil / handler / ssh / client / AsyncSshHandlerWriter.java
index 7753c9fd43a39b8f06247a4356b6f9d73eaef4f7..e9a1d75c55e33c897ad29241dc9ce0792655972d 100644 (file)
@@ -20,8 +20,7 @@ import org.apache.sshd.common.future.SshFutureListener;
 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;
 
@@ -173,14 +172,11 @@ public final class AsyncSshHandlerWriter implements AutoCloseable {
     }
 
     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 {