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:
Woodstox 6.4.0 - Source Code Files
Woodstox 6.4.0 Source Code Files are provided at the Woodstox GitHub Website.
You can download them from the "src/main/java" folder.
You can also browse Woodstox Source Code files below:
✍: FYIcenter
⏎ com/ctc/wstx/io/ISOLatinReader.java
/* Woodstox XML processor * * Copyright (c) 2004- Tatu Saloranta, tatu.saloranta@iki.fi * * Licensed under the License specified in file LICENSE, included with * the source code. * You may not use this file except in compliance with the License. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.ctc.wstx.io; import java.io.*; import com.ctc.wstx.api.ReaderConfig; import com.ctc.wstx.cfg.XmlConsts; /** * Optimized Reader that reads ISO-Latin (aka ISO-8859-1) content from an * input stream. * In addition to doing (hopefully) optimal conversion, it can also take * array of "pre-read" (leftover) bytes; this is necessary when preliminary * stream/reader is trying to figure out XML encoding. */ public final class ISOLatinReader extends BaseReader { boolean mXml11 = false; /** * Total read byte (and char) count; used for error reporting purposes */ int mByteCount = 0; /* //////////////////////////////////////// // Life-cycle //////////////////////////////////////// */ public ISOLatinReader(ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len, boolean recycleBuffer) { super(cfg, in, buf, ptr, len, recycleBuffer); } @Override public void setXmlCompliancy(int xmlVersion) { mXml11 = (xmlVersion == XmlConsts.XML_V_11); } /* //////////////////////////////////////// // Public API //////////////////////////////////////// */ @Override public int read(char[] cbuf, int start, int len) throws IOException { // Let's then ensure there's enough room... if (start < 0 || (start+len) > cbuf.length) { reportBounds(cbuf, start, len); } // Already EOF? if (mByteBuffer == null) { return -1; } if (len < 1) { // dummy call? return 0; } // Need to load more data? int avail = mByteBufferEnd - mBytePtr; if (avail <= 0) { mByteCount += mByteBufferEnd; // Let's always (try to) read full buffers int count = readBytes(); if (count <= 0) { if (count == 0) { reportStrangeStream(); } /* Let's actually then free the buffer right away; shouldn't * yet close the underlying stream though? */ freeBuffers(); // to help GC? return -1; } avail = count; } /* K, have at least one byte == char, good enough; requiring more * could block the calling thread too early */ if (len > avail) { len = avail; } int i = mBytePtr; int last = i + len; if (mXml11) { for (; i < last; ) { char c = (char) (mByteBuffer[i++] & 0xFF); if (c >= CHAR_DEL) { if (c <= 0x9F) { if (c == 0x85) { // NEL, let's convert? c = CONVERT_NEL_TO; } else { // DEL, ctrl chars int pos = mByteCount + i; reportInvalidXml11(c, pos, pos); } } } cbuf[start++] = c; } } else { for (; i < last; ) { cbuf[start++] = (char) (mByteBuffer[i++] & 0xFF); } } mBytePtr = last; return len; } }
⏎ com/ctc/wstx/io/ISOLatinReader.java
Or download all of them as a single archive file:
File name: woodstox-core-6.4.0-fyi.zip File size: 552992 bytes Release date: 2022-10-25 Download
⇒ woodstox-core-6.4.0.jar - Woodstox Core 6.4.0
⇐ What Is Woodstox XML Processing
2023-01-29, 3348👍, 0💬
Popular Posts:
How to download and install JDK (Java Development Kit) 5? If you want to write Java applications, yo...
The Jakarta-ORO Java classes are a set of text-processing Java classes that provide Perl5 compatible...
How to download and install ojdbc11.jar for Oracle 21c? ojdbc11.jar for Oracle 21c is a Java JDBC Dr...
What Is commons-codec-1.4.jar? commons-codec-1.4.jar is the JAR file for Apache Commons Codec 1.4, w...
What Is activation.jar? I heard it's related to JAF (JavaBeans Activation Framework) 1.0.2? The if y...