@Override
    public void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length,
            boolean repeated) throws IOException
    {

        byte[] copiedValue = new byte[length];
        System.arraycopy(value, offset, copiedValue, 0, length);

        if (utf8String)
        {
            generator.pushValue(schema, fieldNumber, new ImmutableStringValueImpl(copiedValue), repeated);
        }
        else
        {
            generator.pushValue(schema, fieldNumber, new ImmutableBinaryValueImpl(copiedValue), repeated);
        }

    }
Before serializing a message/object tied to a schema, this should be called. This also resets the internal state
of this output.
protostuff-msgpack/src/main/java/io/protostuff/MsgpackOutput.java