congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
NativeConverter.decode
Code IndexAdd Tabnine to your IDE (free)

How to use
decode
method
in
libcore.icu.NativeConverter

Best Java code snippets using libcore.icu.NativeConverter.decode (Showing top 14 results out of 315)

origin: robovm/robovm

@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
  if (!in.hasRemaining()) {
    return CoderResult.UNDERFLOW;
  }
  data[INPUT_OFFSET] = getArray(in);
  data[OUTPUT_OFFSET]= getArray(out);
  try {
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, false);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_INVALID_CHAR_FOUND) {
        return CoderResult.unmappableForLength(data[INVALID_BYTES]);
      } else if (error == ICU.U_ILLEGAL_CHAR_FOUND) {
        return CoderResult.malformedForLength(data[INVALID_BYTES]);
      } else {
        throw new AssertionError(error);
      }
    }
    // Decoding succeeded: give us more data.
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(in);
    setPosition(out);
  }
}
origin: robovm/robovm

@Override protected final CoderResult implFlush(CharBuffer out) {
  try {
    // ICU needs to see an empty input.
    input = EmptyArray.BYTE;
    inEnd = 0;
    data[INPUT_OFFSET] = 0;
    data[OUTPUT_OFFSET] = getArray(out);
    data[INVALID_BYTES] = 0; // Make sure we don't see earlier errors.
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, true);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_TRUNCATED_CHAR_FOUND) {
        if (data[INPUT_OFFSET] > 0) {
          return CoderResult.malformedForLength(data[INPUT_OFFSET]);
        }
      }
    }
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(out);
    implReset();
  }
}
origin: com.bugvm/bugvm-rt

@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
  if (!in.hasRemaining()) {
    return CoderResult.UNDERFLOW;
  }
  data[INPUT_OFFSET] = getArray(in);
  data[OUTPUT_OFFSET]= getArray(out);
  try {
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, false);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_INVALID_CHAR_FOUND) {
        return CoderResult.unmappableForLength(data[INVALID_BYTES]);
      } else if (error == ICU.U_ILLEGAL_CHAR_FOUND) {
        return CoderResult.malformedForLength(data[INVALID_BYTES]);
      } else {
        throw new AssertionError(error);
      }
    }
    // Decoding succeeded: give us more data.
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(in);
    setPosition(out);
  }
}
origin: com.gluonhq/robovm-rt

@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
  if (!in.hasRemaining()) {
    return CoderResult.UNDERFLOW;
  }
  data[INPUT_OFFSET] = getArray(in);
  data[OUTPUT_OFFSET]= getArray(out);
  try {
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, false);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_INVALID_CHAR_FOUND) {
        return CoderResult.unmappableForLength(data[INVALID_BYTES]);
      } else if (error == ICU.U_ILLEGAL_CHAR_FOUND) {
        return CoderResult.malformedForLength(data[INVALID_BYTES]);
      } else {
        throw new AssertionError(error);
      }
    }
    // Decoding succeeded: give us more data.
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(in);
    setPosition(out);
  }
}
origin: FlexoVM/flexovm

@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
  if (!in.hasRemaining()) {
    return CoderResult.UNDERFLOW;
  }
  data[INPUT_OFFSET] = getArray(in);
  data[OUTPUT_OFFSET]= getArray(out);
  try {
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, false);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_INVALID_CHAR_FOUND) {
        return CoderResult.unmappableForLength(data[INVALID_BYTES]);
      } else if (error == ICU.U_ILLEGAL_CHAR_FOUND) {
        return CoderResult.malformedForLength(data[INVALID_BYTES]);
      } else {
        throw new AssertionError(error);
      }
    }
    // Decoding succeeded: give us more data.
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(in);
    setPosition(out);
  }
}
origin: MobiVM/robovm

@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
  if (!in.hasRemaining()) {
    return CoderResult.UNDERFLOW;
  }
  data[INPUT_OFFSET] = getArray(in);
  data[OUTPUT_OFFSET]= getArray(out);
  try {
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, false);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_INVALID_CHAR_FOUND) {
        return CoderResult.unmappableForLength(data[INVALID_BYTES]);
      } else if (error == ICU.U_ILLEGAL_CHAR_FOUND) {
        return CoderResult.malformedForLength(data[INVALID_BYTES]);
      } else {
        throw new AssertionError(error);
      }
    }
    // Decoding succeeded: give us more data.
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(in);
    setPosition(out);
  }
}
origin: ibinti/bugvm

@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
  if (!in.hasRemaining()) {
    return CoderResult.UNDERFLOW;
  }
  data[INPUT_OFFSET] = getArray(in);
  data[OUTPUT_OFFSET]= getArray(out);
  try {
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, false);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_INVALID_CHAR_FOUND) {
        return CoderResult.unmappableForLength(data[INVALID_BYTES]);
      } else if (error == ICU.U_ILLEGAL_CHAR_FOUND) {
        return CoderResult.malformedForLength(data[INVALID_BYTES]);
      } else {
        throw new AssertionError(error);
      }
    }
    // Decoding succeeded: give us more data.
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(in);
    setPosition(out);
  }
}
origin: com.mobidevelop.robovm/robovm-rt

@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
  if (!in.hasRemaining()) {
    return CoderResult.UNDERFLOW;
  }
  data[INPUT_OFFSET] = getArray(in);
  data[OUTPUT_OFFSET]= getArray(out);
  try {
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, false);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_INVALID_CHAR_FOUND) {
        return CoderResult.unmappableForLength(data[INVALID_BYTES]);
      } else if (error == ICU.U_ILLEGAL_CHAR_FOUND) {
        return CoderResult.malformedForLength(data[INVALID_BYTES]);
      } else {
        throw new AssertionError(error);
      }
    }
    // Decoding succeeded: give us more data.
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(in);
    setPosition(out);
  }
}
origin: com.mobidevelop.robovm/robovm-rt

@Override protected final CoderResult implFlush(CharBuffer out) {
  try {
    // ICU needs to see an empty input.
    input = EmptyArray.BYTE;
    inEnd = 0;
    data[INPUT_OFFSET] = 0;
    data[OUTPUT_OFFSET] = getArray(out);
    data[INVALID_BYTES] = 0; // Make sure we don't see earlier errors.
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, true);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_TRUNCATED_CHAR_FOUND) {
        if (data[INPUT_OFFSET] > 0) {
          return CoderResult.malformedForLength(data[INPUT_OFFSET]);
        }
      }
    }
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(out);
    implReset();
  }
}
origin: MobiVM/robovm

@Override protected final CoderResult implFlush(CharBuffer out) {
  try {
    // ICU needs to see an empty input.
    input = EmptyArray.BYTE;
    inEnd = 0;
    data[INPUT_OFFSET] = 0;
    data[OUTPUT_OFFSET] = getArray(out);
    data[INVALID_BYTES] = 0; // Make sure we don't see earlier errors.
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, true);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_TRUNCATED_CHAR_FOUND) {
        if (data[INPUT_OFFSET] > 0) {
          return CoderResult.malformedForLength(data[INPUT_OFFSET]);
        }
      }
    }
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(out);
    implReset();
  }
}
origin: ibinti/bugvm

@Override protected final CoderResult implFlush(CharBuffer out) {
  try {
    // ICU needs to see an empty input.
    input = EmptyArray.BYTE;
    inEnd = 0;
    data[INPUT_OFFSET] = 0;
    data[OUTPUT_OFFSET] = getArray(out);
    data[INVALID_BYTES] = 0; // Make sure we don't see earlier errors.
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, true);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_TRUNCATED_CHAR_FOUND) {
        if (data[INPUT_OFFSET] > 0) {
          return CoderResult.malformedForLength(data[INPUT_OFFSET]);
        }
      }
    }
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(out);
    implReset();
  }
}
origin: com.bugvm/bugvm-rt

@Override protected final CoderResult implFlush(CharBuffer out) {
  try {
    // ICU needs to see an empty input.
    input = EmptyArray.BYTE;
    inEnd = 0;
    data[INPUT_OFFSET] = 0;
    data[OUTPUT_OFFSET] = getArray(out);
    data[INVALID_BYTES] = 0; // Make sure we don't see earlier errors.
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, true);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_TRUNCATED_CHAR_FOUND) {
        if (data[INPUT_OFFSET] > 0) {
          return CoderResult.malformedForLength(data[INPUT_OFFSET]);
        }
      }
    }
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(out);
    implReset();
  }
}
origin: com.gluonhq/robovm-rt

@Override protected final CoderResult implFlush(CharBuffer out) {
  try {
    // ICU needs to see an empty input.
    input = EmptyArray.BYTE;
    inEnd = 0;
    data[INPUT_OFFSET] = 0;
    data[OUTPUT_OFFSET] = getArray(out);
    data[INVALID_BYTES] = 0; // Make sure we don't see earlier errors.
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, true);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_TRUNCATED_CHAR_FOUND) {
        if (data[INPUT_OFFSET] > 0) {
          return CoderResult.malformedForLength(data[INPUT_OFFSET]);
        }
      }
    }
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(out);
    implReset();
  }
}
origin: FlexoVM/flexovm

@Override protected final CoderResult implFlush(CharBuffer out) {
  try {
    // ICU needs to see an empty input.
    input = EmptyArray.BYTE;
    inEnd = 0;
    data[INPUT_OFFSET] = 0;
    data[OUTPUT_OFFSET] = getArray(out);
    data[INVALID_BYTES] = 0; // Make sure we don't see earlier errors.
    int error = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, true);
    if (ICU.U_FAILURE(error)) {
      if (error == ICU.U_BUFFER_OVERFLOW_ERROR) {
        return CoderResult.OVERFLOW;
      } else if (error == ICU.U_TRUNCATED_CHAR_FOUND) {
        if (data[INPUT_OFFSET] > 0) {
          return CoderResult.malformedForLength(data[INPUT_OFFSET]);
        }
      }
    }
    return CoderResult.UNDERFLOW;
  } finally {
    setPosition(out);
    implReset();
  }
}
libcore.icuNativeConverterdecode

Popular methods of NativeConverter

  • charsetForName
  • closeConverter
  • contains
  • encode
  • getAvailableCharsetNames
  • getAveBytesPerChar
  • getAveCharsPerByte
  • getMaxBytesPerChar
  • getSubstitutionBytes
  • openConverter
  • resetByteToChar
  • resetCharToByte
  • resetByteToChar,
  • resetCharToByte,
  • setCallbackDecode,
  • setCallbackEncode,
  • translateCodingErrorAction

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • putExtra (Intent)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now