java.nio.charset.MalformedInputException.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中java.nio.charset.MalformedInputException.<init>()方法的一些代码示例,展示了MalformedInputException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MalformedInputException.<init>()方法的具体详情如下:
包路径:java.nio.charset.MalformedInputException
类名称:MalformedInputException
方法名:<init>

MalformedInputException.<init>介绍

[英]Constructs a new MalformedInputException.
[中]构造一个新的格式错误的PutException。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

case 0: // check for ASCII
 if (leadByte > 0x7F)
  throw new MalformedInputException(count);
 break;
case 1:
 if (leadByte < 0xC2 || leadByte > 0xDF)
  throw new MalformedInputException(count);
 state = TRAIL_BYTE_1;
 break;
case 2:
 if (leadByte < 0xE0 || leadByte > 0xEF)
  throw new MalformedInputException(count);
 state = TRAIL_BYTE_1;
 break;
case 3:
 if (leadByte < 0xF0 || leadByte > 0xF4)
  throw new MalformedInputException(count);
 state = TRAIL_BYTE_1;
 break;
 throw new MalformedInputException(count);
 throw new MalformedInputException(count);
if (leadByte == 0xF4 && aByte > 0x8F)
 throw new MalformedInputException(count);
if (leadByte == 0xE0 && aByte < 0xA0)
 throw new MalformedInputException(count);
if (leadByte == 0xED && aByte > 0x9F)
 throw new MalformedInputException(count);

代码示例来源:origin: apache/drill

case 0: // check for ASCII
 if (leadByte > 0x7F) {
  throw new MalformedInputException(count);
  throw new MalformedInputException(count);
case 2:
 if (leadByte < 0xE0 || leadByte > 0xEF) {
  throw new MalformedInputException(count);
case 3:
 if (leadByte < 0xF0 || leadByte > 0xF4) {
  throw new MalformedInputException(count);
 throw new MalformedInputException(count);
 throw new MalformedInputException(count);
 throw new MalformedInputException(count);
 throw new MalformedInputException(count);
 throw new MalformedInputException(count);
 throw new MalformedInputException(count);

代码示例来源:origin: k9mail/k-9

charset = Charset.JISX0201;
  else
    throw new MalformedInputException(0);
} else if (in1 == '$') {
  in1 = mIn.read();
    charset = Charset.JISX0208;
  else
    throw new MalformedInputException(0);
} else
  throw new MalformedInputException(0);
in1 = mIn.read();
int in2 = mIn.read();
if (in2 < 0x21 || in2 >= 0x7f)
  throw new MalformedInputException(0);

代码示例来源:origin: jfinal/jfinal

uc = Character.toCodePoint(c, d);
  } else {
    throw new RuntimeException("encode UTF8 error", new MalformedInputException(1));
  throw new RuntimeException("encode UTF8 error", new MalformedInputException(1));
} else {
  uc = c;

代码示例来源:origin: com.alibaba/fastjson

uc = ((c << 10) + d) + (0x010000 - ('\uD800' << 10) - '\uDC00'); // Character.toCodePoint(c, d)
} else {
  throw new JSONException("encodeUTF8 error", new MalformedInputException(1));

代码示例来源:origin: robovm/robovm

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (malformedInputAction == CodingErrorAction.REPORT && result.isMalformed()) {
    throw new MalformedInputException(result.length());
  } else if (unmappableCharacterAction == CodingErrorAction.REPORT && result.isUnmappable()) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: robovm/robovm

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (result.isMalformed() && malformedInputAction == CodingErrorAction.REPORT) {
    throw new MalformedInputException(result.length());
  } else if (result.isUnmappable() && unmappableCharacterAction == CodingErrorAction.REPORT) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: robovm/robovm

/**
 * Throws an exception corresponding to this coder result.
 *
 * @throws BufferUnderflowException
 *             in case this is an underflow.
 * @throws BufferOverflowException
 *             in case this is an overflow.
 * @throws UnmappableCharacterException
 *             in case this is an unmappable-character error.
 * @throws MalformedInputException
 *             in case this is a malformed-input error.
 * @throws CharacterCodingException
 *             the default exception.
 */
public void throwException() throws BufferUnderflowException,
    BufferOverflowException, UnmappableCharacterException,
    MalformedInputException, CharacterCodingException {
  switch (this.type) {
    case TYPE_UNDERFLOW:
      throw new BufferUnderflowException();
    case TYPE_OVERFLOW:
      throw new BufferOverflowException();
    case TYPE_UNMAPPABLE_CHAR:
      throw new UnmappableCharacterException(this.length);
    case TYPE_MALFORMED_INPUT:
      throw new MalformedInputException(this.length);
    default:
      throw new CharacterCodingException();
  }
}

代码示例来源:origin: jline/jline

throw new MalformedInputException(result.length());
} else if (result.isUnmappable()) {
  throw new UnmappableCharacterException(result.length());

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override public int
read() throws IOException {
  int b = this.in.read();
  if (b != '%') return b;
  int hex1 = Character.digit(this.in.read(), 16);
  if (hex1 == -1) throw new MalformedInputException(2);
  int hex2 = Character.digit(this.in.read(), 16);
  if (hex2 == -1) throw new MalformedInputException(3);
  return (hex1 << 4) + hex2;
}

代码示例来源:origin: de.unkrig.commons/commons-io

@Override public int
read() throws IOException {
  int b = this.in.read();
  if (b != '%') return b;
  int hex1 = Character.digit(this.in.read(), 16);
  if (hex1 == -1) throw new MalformedInputException(2);
  int hex2 = Character.digit(this.in.read(), 16);
  if (hex2 == -1) throw new MalformedInputException(3);
  return (hex1 << 4) + hex2;
}

代码示例来源:origin: MobiVM/robovm

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (result.isMalformed() && malformedInputAction == CodingErrorAction.REPORT) {
    throw new MalformedInputException(result.length());
  } else if (result.isUnmappable() && unmappableCharacterAction == CodingErrorAction.REPORT) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (result.isMalformed() && malformedInputAction == CodingErrorAction.REPORT) {
    throw new MalformedInputException(result.length());
  } else if (result.isUnmappable() && unmappableCharacterAction == CodingErrorAction.REPORT) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (result.isMalformed() && malformedInputAction == CodingErrorAction.REPORT) {
    throw new MalformedInputException(result.length());
  } else if (result.isUnmappable() && unmappableCharacterAction == CodingErrorAction.REPORT) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: ibinti/bugvm

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (malformedInputAction == CodingErrorAction.REPORT && result.isMalformed()) {
    throw new MalformedInputException(result.length());
  } else if (unmappableCharacterAction == CodingErrorAction.REPORT && result.isUnmappable()) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: com.gluonhq/robovm-rt

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (malformedInputAction == CodingErrorAction.REPORT && result.isMalformed()) {
    throw new MalformedInputException(result.length());
  } else if (unmappableCharacterAction == CodingErrorAction.REPORT && result.isUnmappable()) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: MobiVM/robovm

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (malformedInputAction == CodingErrorAction.REPORT && result.isMalformed()) {
    throw new MalformedInputException(result.length());
  } else if (unmappableCharacterAction == CodingErrorAction.REPORT && result.isUnmappable()) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (malformedInputAction == CodingErrorAction.REPORT && result.isMalformed()) {
    throw new MalformedInputException(result.length());
  } else if (unmappableCharacterAction == CodingErrorAction.REPORT && result.isUnmappable()) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (malformedInputAction == CodingErrorAction.REPORT && result.isMalformed()) {
    throw new MalformedInputException(result.length());
  } else if (unmappableCharacterAction == CodingErrorAction.REPORT && result.isUnmappable()) {
    throw new UnmappableCharacterException(result.length());
  }
}

代码示例来源:origin: com.jtransc/jtransc-rt

private void checkCoderResult(CoderResult result) throws CharacterCodingException {
  if (result.isMalformed() && malformedInputAction == CodingErrorAction.REPORT) {
    throw new MalformedInputException(result.length());
  } else if (result.isUnmappable() && unmappableCharacterAction == CodingErrorAction.REPORT) {
    throw new UnmappableCharacterException(result.length());
  }
}

相关文章

微信公众号

最新文章

更多