private byte[] getB64Decoded() throws IOException
    {
        try
        {
            for (int next = parser.next();; next = parser.next())
            {
                switch (next)
                {
                    case CHARACTERS:
                        byte[] decoded = B64Code.cdecode(parser.getTextCharacters(),
                                parser.getTextStart(), parser.getTextLength());

                        while (END_ELEMENT != parser.next())
                            ;

                        // move to next element
                        parser.nextTag();

                        return decoded;

                    case END_ELEMENT:
                        // empty bytestring

                        // move to next element
                        parser.nextTag();

                        return EMPTY;

                    default:
                        continue;
                }
            }
        }
        catch (XMLStreamException e)
        {
            throw new XmlInputException(e);
        }
    }
An input used for reading data with xml format.

@author David Yu
@created May 24, 2010
protostuff-xml/src/main/java/io/protostuff/XmlInput.java