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:
iText 5 itextpdf.jar Source Code
itextpdf.jar is a component in iText 5 Java library to provide core functionalities.
iText Java library allows you to generate and manage PDF documents.
The Source Code files are provided at iText GitHub site.
You can compile it to generate your JAR file, using pom.xml as the build configuration file.
The source code of itextpdf-5.5.14.jar is provided below:
✍: FYIcenter.com
⏎ com/itextpdf/text/pdf/qrcode/BitArray.java
/* * Copyright 2007 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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.itextpdf.text.pdf.qrcode; /** * <p>A simple, fast array of bits, represented compactly by an array of ints internally.</p> * * @author Sean Owen * @since 5.0.2 */ public final class BitArray { // TODO: I have changed these members to be public so ProGuard can inline get() and set(). Ideally // they'd be private and we'd use the -allowaccessmodification flag, but Dalvik rejects the // resulting binary at runtime on Android. If we find a solution to this, these should be changed // back to private. public int[] bits; public final int size; public BitArray(int size) { if (size < 1) { throw new IllegalArgumentException("size must be at least 1"); } this.size = size; this.bits = makeArray(size); } public int getSize() { return size; } /** * @param i bit to get * @return true iff bit i is set */ public boolean get(int i) { return (bits[i >> 5] & (1 << (i & 0x1F))) != 0; } /** * Sets bit i. * * @param i bit to set */ public void set(int i) { bits[i >> 5] |= 1 << (i & 0x1F); } /** * Flips bit i. * * @param i bit to set */ public void flip(int i) { bits[i >> 5] ^= 1 << (i & 0x1F); } /** * Sets a block of 32 bits, starting at bit i. * * @param i first bit to set * @param newBits the new value of the next 32 bits. Note again that the least-significant bit * corresponds to bit i, the next-least-significant to i+1, and so on. */ public void setBulk(int i, int newBits) { bits[i >> 5] = newBits; } /** * Clears all bits (sets to false). */ public void clear() { int max = bits.length; for (int i = 0; i < max; i++) { bits[i] = 0; } } /** * Efficient method to check if a range of bits is set, or not set. * * @param start start of range, inclusive. * @param end end of range, exclusive * @param value if true, checks that bits in range are set, otherwise checks that they are not set * @return true iff all bits are set or not set in range, according to value argument * @throws IllegalArgumentException if end is less than or equal to start */ public boolean isRange(int start, int end, boolean value) { if (end < start) { throw new IllegalArgumentException(); } if (end == start) { return true; // empty range matches } end--; // will be easier to treat this as the last actually set bit -- inclusive int firstInt = start >> 5; int lastInt = end >> 5; for (int i = firstInt; i <= lastInt; i++) { int firstBit = i > firstInt ? 0 : start & 0x1F; int lastBit = i < lastInt ? 31 : end & 0x1F; int mask; if (firstBit == 0 && lastBit == 31) { mask = -1; } else { mask = 0; for (int j = firstBit; j <= lastBit; j++) { mask |= 1 << j; } } // Return false if we're looking for 1s and the masked bits[i] isn't all 1s (that is, // equals the mask, or we're looking for 0s and the masked portion is not all 0s if ((bits[i] & mask) != (value ? mask : 0)) { return false; } } return true; } /** * @return underlying array of ints. The first element holds the first 32 bits, and the least * significant bit is bit 0. */ public int[] getBitArray() { return bits; } /** * Reverses all bits in the array. */ public void reverse() { int[] newBits = new int[bits.length]; int size = this.size; for (int i = 0; i < size; i++) { if (get(size - i - 1)) { newBits[i >> 5] |= 1 << (i & 0x1F); } } bits = newBits; } private static int[] makeArray(int size) { int arraySize = size >> 5; if ((size & 0x1F) != 0) { arraySize++; } return new int[arraySize]; } public String toString() { StringBuffer result = new StringBuffer(size); for (int i = 0; i < size; i++) { if ((i & 0x07) == 0) { result.append(' '); } result.append(get(i) ? 'X' : '.'); } return result.toString(); } }
⏎ com/itextpdf/text/pdf/qrcode/BitArray.java
Or download all of them as a single archive file:
File name: itextpdf-5.5.14-fyi.zip File size: 2163839 bytes Release date: 2009-10-09 Download
⇒ iText-2.1.6.jar - iText, a JAVA-PDF library
⇐ iText layout.jar Source Code
2021-07-03, 74435👍, 0💬
Popular Posts:
XML Serializer, Release 2.7.1, allows you to write out XML, HTML etc. as a stream of characters from...
ASM is an all purpose Java bytecode manipulation and analysis framework. It can be used to modify ex...
JDK 11 java.management.jmod is the JMOD file for JDK 11 Management module. JDK 11 Management module ...
maven-core-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Core module. Apache Maven is a software ...
How to download and install JDK (Java Development Kit) 6? If you want to write Java applications, yo...