public static byte requiredByteAttribute(
            final XMLStreamReader reader,
            final String namespace,
            final String localName) throws XMLStreamException {
        final String value = reader.getAttributeValue(namespace, localName);
        if (value != null) {
            return Byte.parseByte(value);
        }
        throw new XMLStreamException(
                MessageFormat.format("Attribute {0}:{1} is required", namespace, localName));
    }
public static byte requiredByteAttribute ( final XMLStreamReader reader , final String namespace , final String localName ) throws XMLStreamException { final String value = reader . getAttributeValue ( namespace , localName ) ; if ( value != null ) { return Byte . parseByte ( value ) ; } throw new XMLStreamException ( MessageFormat . format ( "Attribute {0}:{1} is required" , namespace , localName ) ) ; }
Returns the value of an attribute as a byte. If the attribute is empty, this method throws an
exception.

@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param namespace
namespace
@param localName
the local name of the attribute.
@return value of attribute as byte
@throws XMLStreamException
if attribute is empty.