public byte[] toBytes() { return toBytes(this.length); }
public static NetconfMessageHeader fromBytes(final byte[] bytes) { // the length is variable therefore bytes between headerBegin and // headerEnd mark the length // the length should be only numbers and therefore easily parsed with // ASCII long length = Long.parseLong(Charsets.US_ASCII.decode( ByteBuffer.wrap(bytes, HEADER_START.length, bytes.length - HEADER_START.length - 1)).toString()); return new NetconfMessageHeader(length); }