static void writeHasBar(Output output, int fieldNumber, HasBar hasBar, boolean repeated)
            throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream(4096);
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        try
        {
            oos.writeObject(hasBar);
            output.writeByteArray(fieldNumber, baos.toByteArray(), repeated);
        }
        finally
        {
            oos.close();
        }
    }
@param hasBar
           the hasBar to set
protostuff-core/src/test/java/io/protostuff/HasHasBar.java