private EzyByteBuffer getRemainBytes(EzyByteBuffer old) { if (!old.hasRemaining()) { return(null); } byte[] bytes = new byte[old.remaining()]; old.get(bytes); return(EzyByteBuffer.wrap(bytes)); }
private EzyByteBuffer mergeBytes(byte[] bytes) { int capacity = buffer.remaining() + bytes.Length; EzyByteBuffer merge = EzyByteBuffer.allocate(capacity); merge.put(buffer); merge.put(bytes); merge.flip(); return(merge); }