Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
Collections:
Other Resources:
Jackson Data Binding Source Code
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
Jackson Databind Source Code files are provided in the source packge (jackson-databind-2.14.0-sources.jar). You can download it at Jackson Maven Website.
You can also browse Jackson Databind Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/databind/node/NodeSerialization.java
package com.fasterxml.jackson.databind.node; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import com.fasterxml.jackson.core.util.ByteArrayBuilder; /** * Helper value class only used during JDK serialization: contains JSON as `byte[]` * * @since 2.10 */ class NodeSerialization implements java.io.Serializable, java.io.Externalizable { // To avoid malicious input only allocate up to 100k protected final static int LONGEST_EAGER_ALLOC = 100_000; private static final long serialVersionUID = 1L; public byte[] json; public NodeSerialization() { } public NodeSerialization(byte[] b) { json = b; } protected Object readResolve() { try { return InternalNodeMapper.bytesToNode(json); } catch (IOException e) { throw new IllegalArgumentException("Failed to JDK deserialize `JsonNode` value: "+e.getMessage(), e); } } public static NodeSerialization from(Object o) { try { return new NodeSerialization(InternalNodeMapper.valueToBytes(o)); } catch (IOException e) { throw new IllegalArgumentException("Failed to JDK serialize `"+o.getClass().getSimpleName()+"` value: "+e.getMessage(), e); } } @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(json.length); out.write(json); } @Override public void readExternal(ObjectInput in) throws IOException { final int len = in.readInt(); json = _read(in, len); } private byte[] _read(ObjectInput in, int expLen) throws IOException { // Common case, just read directly if (expLen <= LONGEST_EAGER_ALLOC) { byte[] result = new byte[expLen]; in.readFully(result, 0, expLen); return result; } // but longer content needs more care to avoid DoS by maliciously crafted data // (this wrt [databind#3328] try (final ByteArrayBuilder bb = new ByteArrayBuilder(LONGEST_EAGER_ALLOC)) { byte[] buffer = bb.resetAndGetFirstSegment(); int outOffset = 0; while (true) { int toRead = Math.min(buffer.length - outOffset, expLen); in.readFully(buffer, 0, toRead); expLen -= toRead; outOffset += toRead; // Did we get everything we needed? If so, we are done if (expLen == 0) { return bb.completeAndCoalesce(outOffset); } // Or perhaps we filled the current segment? If so, finish, get next if (outOffset == buffer.length) { buffer = bb.finishCurrentSegment(); outOffset = 0; } } } } }
⏎ com/fasterxml/jackson/databind/node/NodeSerialization.java
Or download all of them as a single archive file:
File name: jackson-databind-2.14.0-sources.jar File size: 1187952 bytes Release date: 2022-11-05 Download
⇒ Jackson Annotations Source Code
⇐ Download and Install Jackson Binary Package
2022-03-29, 109386👍, 0💬
Popular Posts:
Saxon-HE (home edition) is an open source product available under the Mozilla Public License. It pro...
JDK 11 java.naming.jmod is the JMOD file for JDK 11 Naming module. JDK 11 Naming module compiled cla...
Apache Log4j 1.2 Bridge allows applications coded to use Log4j 1.2 API to use Log4j 2 instead. Bytec...
How to download and install mysql-connector-j-8.0.31 .zip?Connector/J Java library is a JDBC Driver ...
Java Cryptography Extension 1.2.2 JAR File Size and Download Location: File name: jce.jar, jce-1.2.2...