Here you can find the source of putBytesUnescaped(ByteBuffer buffer, byte[] data)
public static void putBytesUnescaped(ByteBuffer buffer, byte[] data)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { public static final byte ESCAPE_CHARACTER = 0x7D; public static void putBytesUnescaped(ByteBuffer buffer, byte[] data) { if (data.length > buffer.remaining()) { throw new IllegalArgumentException("Not enough room in the buffer for the data"); }//from w w w . j av a 2 s . c om for (int ix = 0; ix < data.length; ix++) { byte b = data[ix]; if (b == ESCAPE_CHARACTER) { buffer.put((byte) (data[++ix] ^ 0x20)); } else { buffer.put(b); } } } }