Java Code Examples for com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter#XML_DOMAIN

The following examples show how to use com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter#XML_DOMAIN . 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: ASCIIReader.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Read characters into a portion of an array.  This method will block
 * until some input is available, an I/O error occurs, or the end of the
 * stream is reached.
 *
 * @param      ch     Destination buffer
 * @param      offset Offset at which to start storing characters
 * @param      length Maximum number of characters to read
 *
 * @return     The number of characters read, or -1 if the end of the
 *             stream has been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read(char ch[], int offset, int length) throws IOException {
    if (length > fBuffer.length) {
        length = fBuffer.length;
    }
    int count = fInputStream.read(fBuffer, 0, length);
    for (int i = 0; i < count; i++) {
        int b0 = fBuffer[i];
        if (b0 < 0) {
            throw new MalformedByteSequenceException(fFormatter,
                fLocale, XMLMessageFormatter.XML_DOMAIN,
                "InvalidASCII", new Object [] {Integer.toString(b0 & 0x0FF)});
        }
        ch[offset + i] = (char)b0;
    }
    return count;
}
 
Example 2
Source File: ASCIIReader.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Read characters into a portion of an array.  This method will block
 * until some input is available, an I/O error occurs, or the end of the
 * stream is reached.
 *
 * @param      ch     Destination buffer
 * @param      offset Offset at which to start storing characters
 * @param      length Maximum number of characters to read
 *
 * @return     The number of characters read, or -1 if the end of the
 *             stream has been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read(char ch[], int offset, int length) throws IOException {
    if (length > fBuffer.length) {
        length = fBuffer.length;
    }
    int count = fInputStream.read(fBuffer, 0, length);
    for (int i = 0; i < count; i++) {
        int b0 = fBuffer[i];
        if (b0 < 0) {
            throw new MalformedByteSequenceException(fFormatter,
                fLocale, XMLMessageFormatter.XML_DOMAIN,
                "InvalidASCII", new Object [] {Integer.toString(b0 & 0x0FF)});
        }
        ch[offset + i] = (char)b0;
    }
    return count;
}
 
Example 3
Source File: ASCIIReader.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Read characters into a portion of an array.  This method will block
 * until some input is available, an I/O error occurs, or the end of the
 * stream is reached.
 *
 * @param      ch     Destination buffer
 * @param      offset Offset at which to start storing characters
 * @param      length Maximum number of characters to read
 *
 * @return     The number of characters read, or -1 if the end of the
 *             stream has been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read(char ch[], int offset, int length) throws IOException {
    if (length > fBuffer.length) {
        length = fBuffer.length;
    }
    int count = fInputStream.read(fBuffer, 0, length);
    for (int i = 0; i < count; i++) {
        int b0 = fBuffer[i];
        if (b0 < 0) {
            throw new MalformedByteSequenceException(fFormatter,
                fLocale, XMLMessageFormatter.XML_DOMAIN,
                "InvalidASCII", new Object [] {Integer.toString(b0 & 0x0FF)});
        }
        ch[offset + i] = (char)b0;
    }
    return count;
}
 
Example 4
Source File: ASCIIReader.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Read characters into a portion of an array.  This method will block
 * until some input is available, an I/O error occurs, or the end of the
 * stream is reached.
 *
 * @param      ch     Destination buffer
 * @param      offset Offset at which to start storing characters
 * @param      length Maximum number of characters to read
 *
 * @return     The number of characters read, or -1 if the end of the
 *             stream has been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read(char ch[], int offset, int length) throws IOException {
    if (length > fBuffer.length) {
        length = fBuffer.length;
    }
    int count = fInputStream.read(fBuffer, 0, length);
    for (int i = 0; i < count; i++) {
        int b0 = fBuffer[i];
        if (b0 < 0) {
            throw new MalformedByteSequenceException(fFormatter,
                fLocale, XMLMessageFormatter.XML_DOMAIN,
                "InvalidASCII", new Object [] {Integer.toString(b0 & 0x0FF)});
        }
        ch[offset + i] = (char)b0;
    }
    return count;
}
 
Example 5
Source File: UTF8Reader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Throws an exception for expected byte. */
private void expectedByte(int position, int count)
    throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "ExpectedByte",
        new Object[] {Integer.toString(position), Integer.toString(count)});

}
 
Example 6
Source File: UTF8Reader.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Throws an exception for invalid surrogate bits. */
private void invalidSurrogate(int uuuuu) throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "InvalidHighSurrogate",
        new Object[] {Integer.toHexString(uuuuu)});

}
 
Example 7
Source File: UTF8Reader.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Throws an exception for invalid byte. */
private void invalidByte(int position, int count, int c)
    throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "InvalidByte",
        new Object [] {Integer.toString(position), Integer.toString(count)});

}
 
Example 8
Source File: UTF8Reader.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Throws an exception for expected byte. */
private void expectedByte(int position, int count)
    throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "ExpectedByte",
        new Object[] {Integer.toString(position), Integer.toString(count)});

}
 
Example 9
Source File: UTF8Reader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Throws an exception for invalid surrogate bits. */
private void invalidSurrogate(int uuuuu) throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "InvalidHighSurrogate",
        new Object[] {Integer.toHexString(uuuuu)});

}
 
Example 10
Source File: UTF8Reader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Throws an exception for invalid byte. */
private void invalidByte(int position, int count, int c)
    throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "InvalidByte",
        new Object [] {Integer.toString(position), Integer.toString(count)});

}
 
Example 11
Source File: UTF8Reader.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/** Throws an exception for expected byte. */
private void expectedByte(int position, int count)
    throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "ExpectedByte",
        new Object[] {Integer.toString(position), Integer.toString(count)});

}
 
Example 12
Source File: UTF8Reader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Throws an exception for invalid surrogate bits. */
private void invalidSurrogate(int uuuuu) throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "InvalidHighSurrogate",
        new Object[] {Integer.toHexString(uuuuu)});

}
 
Example 13
Source File: UTF8Reader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Throws an exception for invalid byte. */
private void invalidByte(int position, int count, int c)
    throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "InvalidByte",
        new Object [] {Integer.toString(position), Integer.toString(count)});

}
 
Example 14
Source File: UTF8Reader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Throws an exception for expected byte. */
private void expectedByte(int position, int count)
    throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "ExpectedByte",
        new Object[] {Integer.toString(position), Integer.toString(count)});

}
 
Example 15
Source File: UTF8Reader.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/** Throws an exception for invalid surrogate bits. */
private void invalidSurrogate(int uuuuu) throws MalformedByteSequenceException {

    throw new MalformedByteSequenceException(fFormatter,
        fLocale,
        XMLMessageFormatter.XML_DOMAIN,
        "InvalidHighSurrogate",
        new Object[] {Integer.toHexString(uuuuu)});

}
 
Example 16
Source File: ASCIIReader.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Read a single character.  This method will block until a character is
 * available, an I/O error occurs, or the end of the stream is reached.
 *
 * <p> Subclasses that intend to support efficient single-character input
 * should override this method.
 *
 * @return     The character read, as an integer in the range 0 to 127
 *             (<tt>0x00-0x7f</tt>), or -1 if the end of the stream has
 *             been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read() throws IOException {
    int b0 = fInputStream.read();
    if (b0 >= 0x80) {
        throw new MalformedByteSequenceException(fFormatter,
            fLocale, XMLMessageFormatter.XML_DOMAIN,
            "InvalidASCII", new Object [] {Integer.toString(b0)});
    }
    return b0;
}
 
Example 17
Source File: ASCIIReader.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Read a single character.  This method will block until a character is
 * available, an I/O error occurs, or the end of the stream is reached.
 *
 * <p> Subclasses that intend to support efficient single-character input
 * should override this method.
 *
 * @return     The character read, as an integer in the range 0 to 127
 *             (<tt>0x00-0x7f</tt>), or -1 if the end of the stream has
 *             been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read() throws IOException {
    int b0 = fInputStream.read();
    if (b0 >= 0x80) {
        throw new MalformedByteSequenceException(fFormatter,
            fLocale, XMLMessageFormatter.XML_DOMAIN,
            "InvalidASCII", new Object [] {Integer.toString(b0)});
    }
    return b0;
}
 
Example 18
Source File: ASCIIReader.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Read a single character.  This method will block until a character is
 * available, an I/O error occurs, or the end of the stream is reached.
 *
 * <p> Subclasses that intend to support efficient single-character input
 * should override this method.
 *
 * @return     The character read, as an integer in the range 0 to 127
 *             (<tt>0x00-0x7f</tt>), or -1 if the end of the stream has
 *             been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read() throws IOException {
    int b0 = fInputStream.read();
    if (b0 >= 0x80) {
        throw new MalformedByteSequenceException(fFormatter,
            fLocale, XMLMessageFormatter.XML_DOMAIN,
            "InvalidASCII", new Object [] {Integer.toString(b0)});
    }
    return b0;
}
 
Example 19
Source File: ASCIIReader.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Read a single character.  This method will block until a character is
 * available, an I/O error occurs, or the end of the stream is reached.
 *
 * <p> Subclasses that intend to support efficient single-character input
 * should override this method.
 *
 * @return     The character read, as an integer in the range 0 to 127
 *             (<tt>0x00-0x7f</tt>), or -1 if the end of the stream has
 *             been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read() throws IOException {
    int b0 = fInputStream.read();
    if (b0 >= 0x80) {
        throw new MalformedByteSequenceException(fFormatter,
            fLocale, XMLMessageFormatter.XML_DOMAIN,
            "InvalidASCII", new Object [] {Integer.toString(b0)});
    }
    return b0;
}
 
Example 20
Source File: ASCIIReader.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Read a single character.  This method will block until a character is
 * available, an I/O error occurs, or the end of the stream is reached.
 *
 * <p> Subclasses that intend to support efficient single-character input
 * should override this method.
 *
 * @return     The character read, as an integer in the range 0 to 127
 *             (<tt>0x00-0x7f</tt>), or -1 if the end of the stream has
 *             been reached
 *
 * @exception  IOException  If an I/O error occurs
 */
public int read() throws IOException {
    int b0 = fInputStream.read();
    if (b0 >= 0x80) {
        throw new MalformedByteSequenceException(fFormatter,
            fLocale, XMLMessageFormatter.XML_DOMAIN,
            "InvalidASCII", new Object [] {Integer.toString(b0)});
    }
    return b0;
}