public static byte optionalByteAttribute(
            final XMLStreamReader reader,
            final String namespace,
            final String localName,
            final byte defaultValue) {
        final String value = reader.getAttributeValue(namespace, localName);
        if (value != null) {
            return Byte.parseByte(value);
        }
        return defaultValue;
    }
public static byte optionalByteAttribute ( final XMLStreamReader reader , final String namespace , final String localName , final byte defaultValue ) { final String value = reader . getAttributeValue ( namespace , localName ) ; if ( value != null ) { return Byte . parseByte ( value ) ; } return defaultValue ; }
Returns the value of an attribute as a byte. If the attribute is empty, this method returns
the default value provided.

@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param namespace
String
@param localName
local name of attribute (the namespace is ignored).
@param defaultValue
default value
@return value of attribute, or the default value if the attribute is empty.