Java 8 CharConversionException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 CharConversionException class.

This code example shows how to use the following methods:
            _bytes[_index] = (byte) (0x80 | (c & 0x3F));
            if (++_index >= _bytes.length) {
                flushBuffer(); 
            } 
        } else { 
            throw new CharConversionException("Illegal character U+"
                    + Integer.toHexString(c));
        } 
    } 
 
    /** 
     * Writes a portion of an array of characters. 
     * 
     * @param cbuf the array of characters. 
     * @param off  the offset from which to start writing characters. 
     * @param len  the number of characters to write. 
     * @throws IOException if an I/O error occurs. 
     */ 
    public void write(char cbuf[], int off, int len) throws IOException {
        final int off_plus_len = off + len;
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            _bytes[_index] = (byte) (0x80 | (c & 0x3F));
            if (++_index >= _bytes.length) {
                flushBuffer(); 
            } 
        } else { 
            throw new CharConversionException("Illegal character U+"
                    + Integer.toHexString(c));
        } 
    } 
 
    /** 
     * Writes a portion of an array of characters. 
     * 
     * @param cbuf the array of characters. 
     * @param off  the offset from which to start writing characters. 
     * @param len  the number of characters to write. 
     * @throws IOException if an I/O error occurs. 
     */ 
    public void write(char cbuf[], int off, int len) throws IOException {
        final int off_plus_len = off + len;
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMessage
                throw new CharConversionException();
            fail("Exception not thrown");
        } catch (CharConversionException e) {
            assertNull(
                    "Exception defined with no message answers non-null to getMessage()", 
                    e.getMessage());
        } 
    } 
 
    /** 
     * @tests java.io.CharConversionException#CharConversionException(java.lang.String) 
     */ 
    public void test_ConstructorLjava_lang_String() { 
        try { 
            if (true) // getting around LF 
                throw new CharConversionException("Blah");
            fail("Exception not thrown");
        } catch (CharConversionException e) {
            assertEquals(
                    "Exception defined with no message answers non-null to getMessage()", 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMessage
                throw new CharConversionException();
            fail("Exception not thrown");
        } catch (CharConversionException e) {
            assertNull(
                    "Exception defined with no message answers non-null to getMessage()", 
                    e.getMessage());
        } 
    } 
 
    /** 
     * @tests java.io.CharConversionException#CharConversionException(java.lang.String) 
     */ 
    public void test_ConstructorLjava_lang_String() { 
        try { 
            if (true) // getting around LF 
                throw new CharConversionException("Blah");
            fail("Exception not thrown");
        } catch (CharConversionException e) {
            assertEquals(
                    "Exception defined with no message answers non-null to getMessage()", 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            _bytes[_index] = (byte) (0x80 | (c & 0x3F));
            if (++_index >= _bytes.length) {
                flushBuffer(); 
            } 
        } else { 
            throw new CharConversionException("Illegal character U+"
                    + Integer.toHexString(c));
        } 
    } 
 
    /** 
     * Writes a portion of an array of characters. 
     * 
     * @param  cbuf the array of characters. 
     * @param  off the offset from which to start writing characters. 
     * @param  len the number of characters to write. 
     * @throws IOException if an I/O error occurs. 
     */ 
    public void write(char cbuf[], int off, int len) throws IOException {
        final int off_plus_len = off + len;
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            _byteBuffer.put((byte) (0x80 | ((c >> 18) & 0x3f)));
            _byteBuffer.put((byte) (0x80 | ((c >> 12) & 0x3F)));
            _byteBuffer.put((byte) (0x80 | ((c >> 6) & 0x3F)));
            _byteBuffer.put((byte) (0x80 | (c & 0x3F)));
        } else { 
            throw new CharConversionException("Illegal character U+"
                    + Integer.toHexString(c));
        } 
    } 
 
    /** 
     * Writes a portion of an array of characters. 
     * 
     * @param  cbuf the array of characters. 
     * @param  off the offset from which to start writing characters. 
     * @param  len the number of characters to write. 
     * @throws IOException if an I/O error occurs. 
     */ 
    public void write(char cbuf[], int off, int len) throws IOException {
        final int off_plus_len = off + len;
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    protected char convertToChar(int ch)
        throws CharConversionException
    { 
        if (ch >= 0x80)
        { 
            throw new CharConversionException("Illegal ASCII character, 0x" +
                Integer.toHexString(ch));
        } 
 
        return (char)ch;
    } 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
String filename = _parser.getFilename();
    int line = _parser.getLine();
 
    if (filename != null)
      return new CharConversionException(filename + ":" + line + ": " + msg);
    else 
      return new CharConversionException(msg);
  } 
} 
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            _bytes[_index] = (byte) (0x80 | (c & 0x3F));
            if (++_index >= _bytes.length) {
                flushBuffer(); 
            } 
        } else { 
            throw new CharConversionException("Illegal character U+"
                    + Integer.toHexString(c));
        } 
    } 
 
    /** 
     * Writes a portion of an array of characters. 
     * 
     * @param cbuf the array of characters. 
     * @param off  the offset from which to start writing characters. 
     * @param len  the number of characters to write. 
     * @throws IOException if an I/O error occurs. 
     */ 
    public void write(char cbuf[], int off, int len) throws IOException {
        final int off_plus_len = off + len;
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    int line = _parser.getLine();
 
    if (filename != null)
      return new CharConversionException(filename + ":" + line + ": " + msg);
    else 
      return new CharConversionException(msg);
  } 
} 
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 CharConversionException Methods: