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

x33g5p2x  于2022-01-18 转载在 其他  
字(10.9k)|赞(0)|评价(0)|浏览(103)

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

CoderResult.<init>介绍

[英]Constructs a CoderResult object with its text description.
[中]用文本描述构造CoderResult对象。

代码示例

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

/**
 * Gets a <code>CoderResult</code> object indicating a malformed-input
 * error.
 *
 * @param length
 *            the length of the malformed-input.
 * @return a <code>CoderResult</code> object indicating a malformed-input
 *         error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult malformedForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_malformedErrors) {
      CoderResult r = _malformedErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_MALFORMED_INPUT, length);
        _malformedErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating an unmappable
 * character error.
 *
 * @param length
 *            the length of the input unit sequence denoting the unmappable
 *            character.
 * @return a <code>CoderResult</code> object indicating an unmappable
 *         character error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult unmappableForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_unmappableErrors) {
      CoderResult r = _unmappableErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length);
        _unmappableErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

public static CoderResult unmappableForLength(int length) {
  return new CoderResult(CR_UNMAPPABLE, length);
}

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

public static CoderResult malformedForLength(int length) {
  return new CoderResult(CR_MALFORMED, length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating a malformed-input
 * error.
 *
 * @param length
 *            the length of the malformed-input.
 * @return a <code>CoderResult</code> object indicating a malformed-input
 *         error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult malformedForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_malformedErrors) {
      CoderResult r = _malformedErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_MALFORMED_INPUT, length);
        _malformedErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating a malformed-input
 * error.
 *
 * @param length
 *            the length of the malformed-input.
 * @return a <code>CoderResult</code> object indicating a malformed-input
 *         error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult malformedForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_malformedErrors) {
      CoderResult r = _malformedErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_MALFORMED_INPUT, length);
        _malformedErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating a malformed-input
 * error.
 *
 * @param length
 *            the length of the malformed-input.
 * @return a <code>CoderResult</code> object indicating a malformed-input
 *         error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult malformedForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_malformedErrors) {
      CoderResult r = _malformedErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_MALFORMED_INPUT, length);
        _malformedErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating an unmappable
 * character error.
 *
 * @param length
 *            the length of the input unit sequence denoting the unmappable
 *            character.
 * @return a <code>CoderResult</code> object indicating an unmappable
 *         character error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult unmappableForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_unmappableErrors) {
      CoderResult r = _unmappableErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length);
        _unmappableErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating an unmappable
 * character error.
 *
 * @param length
 *            the length of the input unit sequence denoting the unmappable
 *            character.
 * @return a <code>CoderResult</code> object indicating an unmappable
 *         character error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult unmappableForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_unmappableErrors) {
      CoderResult r = _unmappableErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length);
        _unmappableErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating a malformed-input
 * error.
 *
 * @param length
 *            the length of the malformed-input.
 * @return a <code>CoderResult</code> object indicating a malformed-input
 *         error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult malformedForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_malformedErrors) {
      CoderResult r = _malformedErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_MALFORMED_INPUT, length);
        _malformedErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating an unmappable
 * character error.
 *
 * @param length
 *            the length of the input unit sequence denoting the unmappable
 *            character.
 * @return a <code>CoderResult</code> object indicating an unmappable
 *         character error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult unmappableForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_unmappableErrors) {
      CoderResult r = _unmappableErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length);
        _unmappableErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating an unmappable
 * character error.
 *
 * @param length
 *            the length of the input unit sequence denoting the unmappable
 *            character.
 * @return a <code>CoderResult</code> object indicating an unmappable
 *         character error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult unmappableForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_unmappableErrors) {
      CoderResult r = _unmappableErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length);
        _unmappableErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating a malformed-input
 * error.
 *
 * @param length
 *            the length of the malformed-input.
 * @return a <code>CoderResult</code> object indicating a malformed-input
 *         error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult malformedForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_malformedErrors) {
      CoderResult r = _malformedErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_MALFORMED_INPUT, length);
        _malformedErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Gets a <code>CoderResult</code> object indicating a malformed-input
 * error.
 *
 * @param length
 *            the length of the malformed-input.
 * @return a <code>CoderResult</code> object indicating a malformed-input
 *         error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult malformedForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_malformedErrors) {
      CoderResult r = _malformedErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_MALFORMED_INPUT, length);
        _malformedErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

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

/**
 * Gets a <code>CoderResult</code> object indicating an unmappable
 * character error.
 *
 * @param length
 *            the length of the input unit sequence denoting the unmappable
 *            character.
 * @return a <code>CoderResult</code> object indicating an unmappable
 *         character error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult unmappableForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_unmappableErrors) {
      CoderResult r = _unmappableErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length);
        _unmappableErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Gets a <code>CoderResult</code> object indicating an unmappable
 * character error.
 *
 * @param length
 *            the length of the input unit sequence denoting the unmappable
 *            character.
 * @return a <code>CoderResult</code> object indicating an unmappable
 *         character error.
 * @throws IllegalArgumentException
 *             if <code>length</code> is non-positive.
 */
public static synchronized CoderResult unmappableForLength(int length)
    throws IllegalArgumentException {
  if (length > 0) {
    Integer key = Integer.valueOf(length);
    synchronized (_unmappableErrors) {
      CoderResult r = _unmappableErrors.get(key);
      if (r == null) {
        r = new CoderResult(TYPE_UNMAPPABLE_CHAR, length);
        _unmappableErrors.put(key, r);
      }
      return r;
    }
  }
  throw new IllegalArgumentException("length <= 0: " + length);
}

相关文章