Package java.io

Examples of java.io.CharConversionException


    buff[idx]=buff[j];
      } else {
    // read next 2 digits
    if( j+2 >= cend ) {
        // invalid
        throw new CharConversionException("EOF");
    }
    char b1= buff[j+1];
    char b2=buff[j+2];
    if( !isHexDigit( b1 ) || ! isHexDigit(b2 ))
        throw new CharConversionException("isHexDigit");
   
    j+=2;
    int res=x2c( b1, b2 );
    buff[idx]=(char)res;
      }
View Full Code Here


      } else if( buff[ j ] != '%' ) {
    buff[idx]= buff[j];
      } else {
    // read next 2 digits
    if( j+2 >= end ) {
        throw new CharConversionException("EOF");
    }
    byte b1= buff[j+1];
    byte b2=buff[j+2];
    if( !isHexDigit( b1 ) || ! isHexDigit(b2 ))
        throw new CharConversionException( "isHexDigit");
   
    j+=2;
    int res=x2c( b1, b2 );
    buff[idx]=(byte)res;
      }
View Full Code Here

    buff[idx]=buff[j];
      } else {
    // read next 2 digits
    if( j+2 >= cend ) {
        // invalid
        throw new CharConversionException("EOF");
    }
    char b1= buff[j+1];
    char b2=buff[j+2];
    if( !isHexDigit( b1 ) || ! isHexDigit(b2 ))
        throw new CharConversionException("isHexDigit");
   
    j+=2;
    int res=x2c( b1, b2 );
    buff[idx]=(char)res;
      }
View Full Code Here

            int mult = 1;
            for (int i = valueL - 1; i > colonPos; i--) {
                int charValue = HexUtils.DEC[(int) valueB[i + valueS]];
                if (charValue == -1) {
                    // Invalid character
                    throw new CharConversionException("Invalid char in port: " + valueB[i + valueS]);
                }
                port = port + (charValue * mult);
                mult = 10 * mult;
            }
            request.setServerPort(port);
View Full Code Here

            int mult = 1;
            for (int i = valueL - 1; i > colonPos; i--) {
                int charValue = HexUtils.DEC[(int) valueB[i + valueS]];
                if (charValue == -1) {
                    // Invalid character
                    throw new CharConversionException("Invalid char in port: " + valueB[i + valueS]);
                }
                port = port + (charValue * mult);
                mult = 10 * mult;
            }
            request.setServerPort(port);
View Full Code Here

            if ((c & 0xff00) != 0) { // high order byte must be zero
                String errMsg = lStrings.getString("err.not_iso8859_1");
                Object[] errArgs = new Object[1];
                errArgs[0] = Character.valueOf(c);
                errMsg = MessageFormat.format(errMsg, errArgs);
                throw new CharConversionException(errMsg);
            }
            write(c);
        }
    }
View Full Code Here

            put((byte)(((c >> 12) & 0xF) | 0xE0));
            put((byte)(((c >> 6) & 0x3F) | 0x80));
            put((byte)((c & 0x3F) | 0x80));
            break;
        case 0xD800:
            throw new CharConversionException("invalid surrogate pair");
        }
    }
View Full Code Here

            put((byte)(((c >> 12) & 0xF) | 0xE0));
            put((byte)(((c >> 6) & 0x3F) | 0x80));
            put((byte)((c & 0x3F) | 0x80));
            break;
        case 0xD800:
            throw new CharConversionException("invalid surrogate pair");
        }
    }
View Full Code Here

            int mult = 1;
            for (int i = valueL - 1; i > colonPos; i--) {
                int charValue = HexUtils.DEC[(int) valueB[i + valueS]];
                if (charValue == -1) {
                    // Invalid character
                    throw new CharConversionException("Invalid char in port: " + valueB[i + valueS]);
                }
                port = port + (charValue * mult);
                mult = 10 * mult;
            }
            request.setServerPort(port);
View Full Code Here

      } else if( buff[ j ] != '%' ) {
    buff[idx]= buff[j];
      } else {
    // read next 2 digits
    if( j+2 >= end ) {
        throw new CharConversionException("EOF");
    }
    byte b1= buff[j+1];
    byte b2=buff[j+2];
    if( !isHexDigit( b1 ) || ! isHexDigit(b2 ))
        throw new CharConversionException( "isHexDigit");
   
    j+=2;
    int res=x2c( b1, b2 );
    buff[idx]=(byte)res;
      }
View Full Code Here

TOP

Related Classes of java.io.CharConversionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.