Java Code Examples for com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes#BASE64

The following examples show how to use com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes#BASE64 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FastInfosetConnector.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void processNonIgnorableText() throws SAXException {
    textReported = true;
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        visitor.text(charArray);
    }
}
 
Example 2
Source File: FastInfosetConnector.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void processIgnorableText() throws SAXException {
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
        textReported = true;
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
            visitor.text(charArray);
            textReported = true;
        }
    }
}
 
Example 3
Source File: FastInfosetConnector.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void processNonIgnorableText() throws SAXException {
    textReported = true;
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        visitor.text(charArray);
    }
}
 
Example 4
Source File: FastInfosetConnector.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void processIgnorableText() throws SAXException {
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
        textReported = true;
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
            visitor.text(charArray);
            textReported = true;
        }
    }
}
 
Example 5
Source File: FastInfosetConnector.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void processNonIgnorableText() throws SAXException {
    textReported = true;
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        visitor.text(charArray);
    }
}
 
Example 6
Source File: FastInfosetConnector.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void processIgnorableText() throws SAXException {
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
        textReported = true;
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
            visitor.text(charArray);
            textReported = true;
        }
    }
}
 
Example 7
Source File: FastInfosetConnector.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void processIgnorableText() throws SAXException {
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
        textReported = true;
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
            visitor.text(charArray);
            textReported = true;
        }
    }
}
 
Example 8
Source File: FastInfosetConnector.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void processIgnorableText() throws SAXException {
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
        textReported = true;
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
            visitor.text(charArray);
            textReported = true;
        }
    }
}
 
Example 9
Source File: FastInfosetConnector.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void processIgnorableText() throws SAXException {
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
        textReported = true;
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
            visitor.text(charArray);
            textReported = true;
        }
    }
}
 
Example 10
Source File: FastInfosetConnector.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void processNonIgnorableText() throws SAXException {
    textReported = true;
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        visitor.text(charArray);
    }
}
 
Example 11
Source File: FastInfosetConnector.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void processNonIgnorableText() throws SAXException {
    textReported = true;
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        visitor.text(charArray);
    }
}
 
Example 12
Source File: FastInfosetConnector.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void processNonIgnorableText() throws SAXException {
    textReported = true;
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        visitor.text(charArray);
    }
}
 
Example 13
Source File: FastInfosetConnector.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void processIgnorableText() throws SAXException {
    boolean isTextAlgorithmAplied =
            (fastInfosetStreamReader.getTextAlgorithmBytes() != null);

    if (isTextAlgorithmAplied &&
            fastInfosetStreamReader.getTextAlgorithmIndex() == EncodingAlgorithmIndexes.BASE64) {
        base64Data.set(fastInfosetStreamReader.getTextAlgorithmBytesClone(),null);
        visitor.text(base64Data);
        textReported = true;
    } else {
        if (isTextAlgorithmAplied) {
            fastInfosetStreamReader.getText();
        }

        charArray.set();
        if (!WhiteSpaceProcessor.isWhiteSpace(charArray)) {
            visitor.text(charArray);
            textReported = true;
        }
    }
}
 
Example 14
Source File: StAXDocumentParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example 15
Source File: StAXDocumentParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example 16
Source File: StAXDocumentParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected final void convertEncodingAlgorithmDataToCharacters() throws FastInfosetException, IOException {
    StringBuffer buffer = new StringBuffer();
    if (_algorithmId == EncodingAlgorithmIndexes.BASE64) {
        convertBase64AlorithmDataToCharacters(buffer);
    } else if (_algorithmId < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
        Object array = BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).
                decodeFromBytes(_algorithmData, _algorithmDataOffset, _algorithmDataLength);
        BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).convertToCharacters(array,  buffer);
    } else if (_algorithmId == EncodingAlgorithmIndexes.CDATA) {
        _octetBufferOffset -= _octetBufferLength;
        decodeUtf8StringIntoCharBuffer();

        _characters = _charBuffer;
        _charactersOffset = 0;
        return;
    } else if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
        final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(_algorithmURI);
        if (ea != null) {
            final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
            ea.convertToCharacters(data, buffer);
        } else {
            throw new EncodingAlgorithmException(
                    CommonResourceBundle.getInstance().getString("message.algorithmDataCannotBeReported"));
        }
    }

    _characters = new char[buffer.length()];
    buffer.getChars(0, buffer.length(), _characters, 0);
    _charactersOffset = 0;
    _charBufferLength = _characters.length;
}
 
Example 17
Source File: StAXDocumentParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example 18
Source File: StAXDocumentParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected final void convertEncodingAlgorithmDataToCharacters() throws FastInfosetException, IOException {
    StringBuffer buffer = new StringBuffer();
    if (_algorithmId == EncodingAlgorithmIndexes.BASE64) {
        convertBase64AlorithmDataToCharacters(buffer);
    } else if (_algorithmId < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
        Object array = BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).
                decodeFromBytes(_algorithmData, _algorithmDataOffset, _algorithmDataLength);
        BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).convertToCharacters(array,  buffer);
    } else if (_algorithmId == EncodingAlgorithmIndexes.CDATA) {
        _octetBufferOffset -= _octetBufferLength;
        decodeUtf8StringIntoCharBuffer();

        _characters = _charBuffer;
        _charactersOffset = 0;
        return;
    } else if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
        final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(_algorithmURI);
        if (ea != null) {
            final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
            ea.convertToCharacters(data, buffer);
        } else {
            throw new EncodingAlgorithmException(
                    CommonResourceBundle.getInstance().getString("message.algorithmDataCannotBeReported"));
        }
    }

    _characters = new char[buffer.length()];
    buffer.getChars(0, buffer.length(), _characters, 0);
    _charactersOffset = 0;
    _charBufferLength = _characters.length;
}
 
Example 19
Source File: StAXDocumentParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example 20
Source File: StAXDocumentParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected final void convertEncodingAlgorithmDataToCharacters() throws FastInfosetException, IOException {
    StringBuffer buffer = new StringBuffer();
    if (_algorithmId == EncodingAlgorithmIndexes.BASE64) {
        convertBase64AlorithmDataToCharacters(buffer);
    } else if (_algorithmId < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
        Object array = BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).
                decodeFromBytes(_algorithmData, _algorithmDataOffset, _algorithmDataLength);
        BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).convertToCharacters(array,  buffer);
    } else if (_algorithmId == EncodingAlgorithmIndexes.CDATA) {
        _octetBufferOffset -= _octetBufferLength;
        decodeUtf8StringIntoCharBuffer();

        _characters = _charBuffer;
        _charactersOffset = 0;
        return;
    } else if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
        final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(_algorithmURI);
        if (ea != null) {
            final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
            ea.convertToCharacters(data, buffer);
        } else {
            throw new EncodingAlgorithmException(
                    CommonResourceBundle.getInstance().getString("message.algorithmDataCannotBeReported"));
        }
    }

    _characters = new char[buffer.length()];
    buffer.getChars(0, buffer.length(), _characters, 0);
    _charactersOffset = 0;
    _charBufferLength = _characters.length;
}