Tabnine Logo
UTF32Reader
Code IndexAdd Tabnine to your IDE (free)

How to use
UTF32Reader
in
com.fasterxml.jackson.core.io

Best Java code snippets using com.fasterxml.jackson.core.io.UTF32Reader (Showing top 20 results out of 315)

origin: redisson/redisson

@SuppressWarnings("resource")
public Reader constructReader() throws IOException
{
  JsonEncoding enc = _context.getEncoding();
  switch (enc.bits()) {
  case 8: // only in non-common case where we don't want to do direct mapping
  case 16:
    {
      // First: do we have a Stream? If not, need to create one:
      InputStream in = _in;
      if (in == null) {
        in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd);
      } else {
        /* Also, if we have any read but unused input (usually true),
         * need to merge that input in:
         */
        if (_inputPtr < _inputEnd) {
          in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd);
        }
      }
      return new InputStreamReader(in, enc.getJavaName());
    }
  case 32:
    return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd,
        _context.getEncoding().isBigEndian());
  }
  throw new RuntimeException("Internal error"); // should never get here
}
origin: redisson/redisson

if (count < 0) { // -1
  if (_managedBuffers) {
    freeBuffers(); // to help GC?
reportStrangeStream();
if (count < 0) { // -1, EOF... no good!
  if (_managedBuffers) {
    freeBuffers(); // to help GC?
  reportUnexpectedEOF(_length, 4);
reportStrangeStream();
origin: redisson/redisson

reportBounds(cbuf, start, len);
  if (!loadMore(left)) { // (legal) EOF?
    reportUnexpectedEOF(_length - _ptr, 4);
  int ch = ((hi - 1) << 16) | lo; // ch -= 0x10000; to normalize starting with 0x0
  if (hi > 0x10) { // last valid is 0x10FFFF
    reportInvalid(ch, outPtr-start,
        String.format(" (above 0x%08x)", LAST_VALID_UNICODE_CHAR));
origin: com.eclipsesource.jaxrs/jersey-all

reportBounds(cbuf, start, len);
  if (!loadMore(left)) { // (legal) EOF?
    return -1;
    reportInvalid(ch, outPtr-start,
           "(above "+Integer.toHexString(LAST_VALID_UNICODE_CHAR)+") ");
origin: redisson/redisson

@Override
public void close() throws IOException {
  InputStream in = _in;
  if (in != null) {
    _in = null;
    freeBuffers();
    in.close();
  }
}
origin: redisson/redisson

/**
 * Although this method is implemented by the base class, AND it should
 * never be called by main code, let's still implement it bit more
 * efficiently just in case
 */
@Override
public int read() throws IOException {
  if (_tmpBuf == null) {
    _tmpBuf = new char[1];
  }
  if (read(_tmpBuf, 0, 1) < 1) {
    return -1;
  }
  return _tmpBuf[0];
}

origin: hstaudacher/osgi-jax-rs-connector

reportBounds(cbuf, start, len);
  if (!loadMore(left)) { // (legal) EOF?
    return -1;
    reportInvalid(ch, outPtr-start,
           "(above "+Integer.toHexString(LAST_VALID_UNICODE_CHAR)+") ");
origin: FasterXML/jackson-core

@Override
public void close() throws IOException {
  InputStream in = _in;
  if (in != null) {
    _in = null;
    freeBuffers();
    in.close();
  }
}
origin: FasterXML/jackson-core

/**
 * Although this method is implemented by the base class, AND it should
 * never be called by main code, let's still implement it bit more
 * efficiently just in case
 */
@Override
public int read() throws IOException {
  if (_tmpBuf == null) {
    _tmpBuf = new char[1];
  }
  if (read(_tmpBuf, 0, 1) < 1) {
    return -1;
  }
  return _tmpBuf[0];
}

origin: FasterXML/jackson-core

if (count < 0) { // -1
  if (_managedBuffers) {
    freeBuffers(); // to help GC?
reportStrangeStream();
if (count < 0) { // -1, EOF... no good!
  if (_managedBuffers) {
    freeBuffers(); // to help GC?
  reportUnexpectedEOF(_length, 4);
reportStrangeStream();
origin: FasterXML/jackson-core

reportBounds(cbuf, start, len);
  if (!loadMore(left)) { // (legal) EOF?
    reportUnexpectedEOF(_length - _ptr, 4);
  int ch = ((hi - 1) << 16) | lo; // ch -= 0x10000; to normalize starting with 0x0
  if (hi > 0x10) { // last valid is 0x10FFFF
    reportInvalid(ch, outPtr-start,
        String.format(" (above 0x%08x)", LAST_VALID_UNICODE_CHAR));
origin: Nextdoor/bender

reportBounds(cbuf, start, len);
  if (!loadMore(left)) { // (legal) EOF?
    return -1;
    reportInvalid(ch, outPtr-start,
           "(above "+Integer.toHexString(LAST_VALID_UNICODE_CHAR)+") ");
origin: FasterXML/jackson-core

@SuppressWarnings("resource")
public Reader constructReader() throws IOException
{
  JsonEncoding enc = _context.getEncoding();
  switch (enc.bits()) {
  case 8: // only in non-common case where we don't want to do direct mapping
  case 16:
    {
      // First: do we have a Stream? If not, need to create one:
      InputStream in = _in;
      if (in == null) {
        in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd);
      } else {
        /* Also, if we have any read but unused input (usually true),
         * need to merge that input in:
         */
        if (_inputPtr < _inputEnd) {
          in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd);
        }
      }
      return new InputStreamReader(in, enc.getJavaName());
    }
  case 32:
    return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd,
        _context.getEncoding().isBigEndian());
  }
  throw new RuntimeException("Internal error"); // should never get here
}
origin: com.eclipsesource.jaxrs/jersey-all

@Override
public void close() throws IOException {
  InputStream in = _in;
  if (in != null) {
    _in = null;
    freeBuffers();
    in.close();
  }
}
origin: hstaudacher/osgi-jax-rs-connector

/**
 * Although this method is implemented by the base class, AND it should
 * never be called by main code, let's still implement it bit more
 * efficiently just in case
 */
@Override
public int read() throws IOException {
  if (_tmpBuf == null) {
    _tmpBuf = new char[1];
  }
  if (read(_tmpBuf, 0, 1) < 1) {
    return -1;
  }
  return _tmpBuf[0];
}

origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-core

  _length = 0;
  if (count < 0) { // -1
    freeBuffers(); // to help GC?
    return false;
  reportStrangeStream();
if (count < 1) {
  if (count < 0) { // -1, EOF... no good!
    freeBuffers(); // to help GC?
    reportUnexpectedEOF(_length, 4);
  reportStrangeStream();
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

reportBounds(cbuf, start, len);
  if (!loadMore(left)) { // (legal) EOF?
    reportUnexpectedEOF(_length - _ptr, 4);
  int ch = ((hi - 1) << 16) | lo; // ch -= 0x10000; to normalize starting with 0x0
  if (hi > 0x10) { // last valid is 0x10FFFF
    reportInvalid(ch, outPtr-start,
        String.format(" (above 0x%08x)", LAST_VALID_UNICODE_CHAR));
origin: com.ning.billing/killbill-osgi-bundles-analytics

reportBounds(cbuf, start, len);
  if (!loadMore(left)) { // (legal) EOF?
    return -1;
    reportInvalid(ch, outPtr-start,
           "(above "+Integer.toHexString(LAST_VALID_UNICODE_CHAR)+") ");
origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-core

public Reader constructReader()
  throws IOException
{
  JsonEncoding enc = _context.getEncoding();
  switch (enc) { 
  case UTF32_BE:
  case UTF32_LE:
    return new UTF32Reader(_context, _in, _inputBuffer, _inputPtr, _inputEnd,
                _context.getEncoding().isBigEndian());
  case UTF16_BE:
  case UTF16_LE:
  case UTF8: // only in non-common case where we don't want to do direct mapping
    {
      // First: do we have a Stream? If not, need to create one:
      InputStream in = _in;
      if (in == null) {
        in = new ByteArrayInputStream(_inputBuffer, _inputPtr, _inputEnd);
      } else {
        /* Also, if we have any read but unused input (usually true),
         * need to merge that input in:
         */
        if (_inputPtr < _inputEnd) {
          in = new MergedStream(_context, in, _inputBuffer, _inputPtr, _inputEnd);
        }
      }
      return new InputStreamReader(in, enc.getJavaName());
    }
  }
  throw new RuntimeException("Internal error"); // should never get here
}
origin: Nextdoor/bender

@Override
public void close() throws IOException {
  InputStream in = _in;
  if (in != null) {
    _in = null;
    freeBuffers();
    in.close();
  }
}
com.fasterxml.jackson.core.ioUTF32Reader

Javadoc

Since JDK does not come with UTF-32/UCS-4, let's implement a simple decoder to use.

Most used methods

  • <init>
  • freeBuffers
    This method should be called along with (or instead of) normal close. After calling this method, no
  • loadMore
  • reportBounds
  • reportInvalid
  • reportStrangeStream
  • reportUnexpectedEOF
  • read

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • getExternalFilesDir (Context)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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