Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Jackson Core Source Code
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
Jackson Core Source Code files are provided in the source packge (jackson-core-2.14.0-sources.jar). You can download it at Jackson Maven Website.
You can also browse Jackson Core Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/core/json/async/NonBlockingJsonParser.java
package com.fasterxml.jackson.core.json.async;
import java.io.IOException;
import java.io.OutputStream;
import com.fasterxml.jackson.core.async.ByteArrayFeeder;
import com.fasterxml.jackson.core.io.IOContext;
import com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer;
/**
* Non-blocking parser implementation for JSON content that takes its input
* via {@code byte[]} passed.
*<p>
* NOTE: only supports parsing of UTF-8 encoded content (and 7-bit US-ASCII since
* it is strict subset of UTF-8): other encodings are not supported.
*
* @since 2.9
*/
public class NonBlockingJsonParser
extends NonBlockingUtf8JsonParserBase
implements ByteArrayFeeder
{
private byte[] _inputBuffer = NO_BYTES;
public NonBlockingJsonParser(IOContext ctxt, int parserFeatures,
ByteQuadsCanonicalizer sym) {
super(ctxt, parserFeatures, sym);
}
@Override
public ByteArrayFeeder getNonBlockingInputFeeder() {
return this;
}
@Override
public void feedInput(final byte[] buf, final int start, final int end) throws IOException {
// Must not have remaining input
if (_inputPtr < _inputEnd) {
_reportError("Still have %d undecoded bytes, should not call 'feedInput'", _inputEnd - _inputPtr);
}
if (end < start) {
_reportError("Input end (%d) may not be before start (%d)", end, start);
}
// and shouldn't have been marked as end-of-input
if (_endOfInput) {
_reportError("Already closed, can not feed more input");
}
// Time to update pointers first
_currInputProcessed += _origBufferLen;
// Also need to adjust row start, to work as if it extended into the past wrt new buffer
_currInputRowStart = start - (_inputEnd - _currInputRowStart);
// And then update buffer settings
_currBufferStart = start;
_inputBuffer = buf;
_inputPtr = start;
_inputEnd = end;
_origBufferLen = end - start;
}
@Override
public int releaseBuffered(final OutputStream out) throws IOException {
final int avail = _inputEnd - _inputPtr;
if (avail > 0) {
out.write(_inputBuffer, _inputPtr, avail);
}
return avail;
}
@Override
protected byte getNextSignedByteFromBuffer() {
return _inputBuffer[_inputPtr++];
}
@Override
protected int getNextUnsignedByteFromBuffer() {
return _inputBuffer[_inputPtr++] & 0xFF;
}
@Override
protected byte getByteFromBuffer(final int ptr) {
return _inputBuffer[ptr];
}
}
⏎ com/fasterxml/jackson/core/json/async/NonBlockingJsonParser.java
Or download all of them as a single archive file:
File name: jackson-core-2.14.0-sources.jar File size: 497693 bytes Release date: 2022-11-05 Download
⇒ Download and Install Jackson Binary Package
2016-02-03, ≈85🔥, 1💬
Popular Posts:
XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with ...
What is the dom\GetElementsByTagName .javaprovided in the Apache Xerces package? I have Apache Xerce...
Java Servlet API 4.0.1 Source Code Files are important if you want to compile them with different JD...
What Is HttpComponents httpcore-4.2.2.jar? HttpComponents httpcore-4.2.2.jar is the JAR file for Apa...
XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with ...