@Override
    public void writeByteArray(int fieldNumber, byte[] value, boolean repeated) throws IOException
    {
        writeB64(schema.getFieldName(fieldNumber), value, 0, value.length, repeated);
    }
Before serializing a message/object tied to a schema, this should be called.
protostuff-xml/src/main/java/io/protostuff/XmlXOutput.java