if (outputBuffer.position() == outputBuffer.capacity() - 1) {
final ByteBuffer tmpBuffer = ByteBufferFactory.allocateView(outputBuffer.capacity() * 2, USE_DIRECT_BUFFER);
tmpBuffer.put(outputBuffer);
outputBuffer = tmpBuffer;
}
outputBuffer.put((byte) data);