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/io/MergedStream.java
package com.fasterxml.jackson.core.io; import java.io.*; /** * Simple {@link InputStream} implementation that is used to "unwind" some * data previously read from an input stream; so that as long as some of * that data remains, it's returned; but as long as it's read, we'll * just use data from the underlying original stream. * This is similar to {@link java.io.PushbackInputStream}, but here there's * only one implicit pushback, when instance is constructed. */ public final class MergedStream extends InputStream { final private IOContext _ctxt; final private InputStream _in; private byte[] _b; private int _ptr; final private int _end; public MergedStream(IOContext ctxt, InputStream in, byte[] buf, int start, int end) { _ctxt = ctxt; _in = in; _b = buf; _ptr = start; _end = end; } @Override public int available() throws IOException { if (_b != null) { return _end - _ptr; } return _in.available(); } @Override public void close() throws IOException { _free(); _in.close(); } @Override public synchronized void mark(int readlimit) { if (_b == null) { _in.mark(readlimit); } } @Override public boolean markSupported() { // Only supports marks past the initial rewindable section... return (_b == null) && _in.markSupported(); } @Override public int read() throws IOException { if (_b != null) { int c = _b[_ptr++] & 0xFF; if (_ptr >= _end) { _free(); } return c; } return _in.read(); } @Override public int read(byte[] b) throws IOException { return read(b, 0, b.length); } @Override public int read(byte[] b, int off, int len) throws IOException { if (_b != null) { int avail = _end - _ptr; if (len > avail) { len = avail; } System.arraycopy(_b, _ptr, b, off, len); _ptr += len; if (_ptr >= _end) { _free(); } return len; } return _in.read(b, off, len); } @Override public synchronized void reset() throws IOException { if (_b == null) { _in.reset(); } } @Override public long skip(long n) throws IOException { long count = 0L; if (_b != null) { int amount = _end - _ptr; if (amount > n) { // all in pushed back segment? _ptr += (int) n; return n; } _free(); count += amount; n -= amount; } if (n > 0) { count += _in.skip(n); } return count; } private void _free() { byte[] buf = _b; if (buf != null) { _b = null; if (_ctxt != null) { _ctxt.releaseReadIOBuffer(buf); } } } }
⏎ com/fasterxml/jackson/core/io/MergedStream.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, ≈69🔥, 1💬
Popular Posts:
JDK 11 jdk.crypto.cryptoki.jmod is the JMOD file for JDK 11 Crypto Cryptoki module. JDK 11 Crypto KI...
JDK 11 jdk.jlink.jmod is the JMOD file for JDK 11 JLink tool, which can be invoked by the "jlink" co...
ANTLR is a powerful parser generator for multiple programming languages including Java. ANTLR contai...
Apache Neethi provides general framework for the programmers to use WS Policy. It is compliant with ...
JDK 11 jrt-fs.jar is the JAR file for JDK 11 JRT-FS (Java RunTime - File System) defined in the "jdk...