src/main/java/org/beykery/jkcp/Kcp.java
private int encode(ByteBuf buf) {
            int off = buf.writerIndex();
            buf.writeIntLE(conv);
            buf.writeByte(cmd);
            buf.writeByte(frg);
            buf.writeShortLE(wnd);
            buf.writeIntLE(ts);
            buf.writeIntLE(sn);
            buf.writeIntLE(una);
            buf.writeIntLE(data == null ? 0 : data.readableBytes());
            return buf.writerIndex() - off;
        }
/**
         * encode a segment into buffer
         *
         * @param buf
         * @return
         */
encode a segment into buffer
@param buf
@return
encode a segment into buffer @param buf @return
private int encode(ByteBuf buf) {
            int off = buf.writerIndex();
            buf.writeIntLE(conv);
            buf.writeByte(cmd);
            buf.writeByte(frg);
            buf.writeShortLE(wnd);
            buf.writeIntLE(ts);
            buf.writeIntLE(sn);
            buf.writeIntLE(una);
            buf.writeIntLE(data == null ? 0 : data.readableBytes());
            return buf.writerIndex() - off;
        }
private int encode ( ByteBuf buf ) { int off = buf . writerIndex ( ) ; buf . writeIntLE ( conv ) ; buf . writeByte ( cmd ) ; buf . writeByte ( frg ) ; buf . writeShortLE ( wnd ) ; buf . writeIntLE ( ts ) ; buf . writeIntLE ( sn ) ; buf . writeIntLE ( una ) ; buf . writeIntLE ( data == null ? 0 : data . readableBytes ( ) ) ; return buf . writerIndex ( ) - off ; }
encode a segment into buffer
 @param buf
 @return
encode a segment into buffer @param buf @return