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:
What Is jxl.jar 2.6.12
What is jxl.jar 2.6.12?
✍: fyicenter.com
jxl.jar 2.6.12 is the JAR file for Java Excel API 2.6.12, which is a Java library for reading, writing and modifying Microsoft Excel spreadsheet files.
JAR File Size and Download Location:
JAR name: jxl-2.6.12.jar Target JDK version: 1.6 Dependency: None File name: jxl.jar File size: 725735 bytes Release date: 24-Oct-2009 Download: Java Excel API Website.
Here are Java Source Code files for jxl-2.6.12.jar:
⏎ jxl/read/biff/File.java
/********************************************************************* * * Copyright (C) 2002 Andrew Khan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ package jxl.read.biff; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; import jxl.common.Logger; import jxl.WorkbookSettings; import jxl.biff.BaseCompoundFile; import jxl.biff.IntegerHelper; import jxl.biff.Type; /** * File containing the data from the binary stream */ public class File { /** * The logger */ private static Logger logger = Logger.getLogger(File.class); /** * The data from the excel 97 file */ private byte[] data; /** * The current position within the file */ private int filePos; /** * The saved pos */ private int oldPos; /** * The initial file size */ private int initialFileSize; /** * The amount to increase the growable array by */ private int arrayGrowSize; /** * A handle to the compound file. This is only preserved when the * copying of PropertySets is enabled */ private CompoundFile compoundFile; /** * The workbook settings */ private WorkbookSettings workbookSettings; /** * Constructs a file from the input stream * * @param is the input stream * @param ws the workbook settings * @exception IOException * @exception BiffException */ public File(InputStream is, WorkbookSettings ws) throws IOException, BiffException { // Initialize the file sizing parameters from the settings workbookSettings = ws; initialFileSize = workbookSettings.getInitialFileSize(); arrayGrowSize = workbookSettings.getArrayGrowSize(); byte[] d = new byte[initialFileSize]; int bytesRead = is.read(d); int pos = bytesRead; // Handle thread interruptions, in case the user keeps pressing // the Submit button from a browser. Thanks to Mike Smith for this if (Thread.currentThread().isInterrupted()) { throw new InterruptedIOException(); } while (bytesRead != -1) { if (pos >= d.length) { // Grow the array byte[] newArray = new byte[d.length + arrayGrowSize]; System.arraycopy(d, 0, newArray, 0, d.length); d = newArray; } bytesRead = is.read(d, pos, d.length - pos); pos += bytesRead; if (Thread.currentThread().isInterrupted()) { throw new InterruptedIOException(); } } bytesRead = pos + 1; // Perform file reading checks and throw exceptions as necessary if (bytesRead == 0) { throw new BiffException(BiffException.excelFileNotFound); } CompoundFile cf = new CompoundFile(d, ws); try { data = cf.getStream("workbook"); } catch (BiffException e) { // this might be in excel 95 format - try again data = cf.getStream("book"); } if (!workbookSettings.getPropertySetsDisabled() && (cf.getNumberOfPropertySets() > BaseCompoundFile.STANDARD_PROPERTY_SETS.length)) { compoundFile = cf; } cf = null; if (!workbookSettings.getGCDisabled()) { System.gc(); } // Uncomment the following lines to send the pure workbook stream // (ie. a defragged ole stream) to an output file // FileOutputStream fos = new FileOutputStream("defraggedxls"); // fos.write(data); // fos.close(); } /** * Constructs a file from already defragged binary data. Useful for * displaying subportions of excel streams. This is only used during * special runs of the "BiffDump" demo program and should not be invoked * as part of standard JExcelApi parsing * * @param d the already parsed data */ public File(byte[] d) { data = d; } /** * Returns the next data record and increments the pointer * * @return the next data record */ Record next() { Record r = new Record(data, filePos, this); return r; } /** * Peek ahead to the next record, without incrementing the file position * * @return the next record */ Record peek() { int tempPos = filePos; Record r = new Record(data, filePos, this); filePos = tempPos; return r; } /** * Skips forward the specified number of bytes * * @param bytes the number of bytes to skip forward */ public void skip(int bytes) { filePos += bytes; } /** * Copies the bytes into a new array and returns it. * * @param pos the position to read from * @param length the number of bytes to read * @return The bytes read */ public byte[] read(int pos, int length) { byte[] ret = new byte[length]; try { System.arraycopy(data, pos, ret, 0, length); } catch (ArrayIndexOutOfBoundsException e) { logger.error("Array index out of bounds at position " + pos + " record length " + length); throw e; } return ret; } /** * Gets the position in the stream * * @return the position in the stream */ public int getPos() { return filePos; } /** * Saves the current position and temporarily sets the position to be the * new one. The original position may be restored usind the restorePos() * method. This is used when reading in the cell values of the sheet - an * addition in 1.6 for memory allocation reasons. * * These methods are used by the SheetImpl.readSheet() when it is reading * in all the cell values * * @param p the temporary position */ public void setPos(int p) { oldPos = filePos; filePos = p; } /** * Restores the original position * * These methods are used by the SheetImpl.readSheet() when it is reading * in all the cell values */ public void restorePos() { filePos = oldPos; } /** * Moves to the first bof in the file */ private void moveToFirstBof() { boolean bofFound = false; while (!bofFound) { int code = IntegerHelper.getInt(data[filePos], data[filePos + 1]); if (code == Type.BOF.value) { bofFound = true; } else { skip(128); } } } /** * "Closes" the biff file * * @deprecated As of version 1.6 use workbook.close() instead */ public void close() { } /** * Clears the contents of the file */ public void clear() { data = null; } /** * Determines if the current position exceeds the end of the file * * @return TRUE if there is more data left in the array, FALSE otherwise */ public boolean hasNext() { // Allow four bytes for the record code and its length return filePos < data.length - 4; } /** * Accessor for the compound file. The returned value will only be non-null * if the property sets feature is enabled and the workbook contains * additional property sets * * @return the compound file */ CompoundFile getCompoundFile() { return compoundFile; } }
⏎ jxl/read/biff/File.java
Or download all of them as a single archive file:
File name: jxl-2.6.12-src.zip File size: 824057 bytes Release date: 2009-10-24 Download
⇐ What Is jexcelapi_2_6_12.zip
2017-06-09, 69539👍, 6💬
Popular Posts:
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was develo...
JDK 11 jdk.scripting.nashorn.jm odis the JMOD file for JDK 11 Scripting Nashorn module. JDK 11 Scrip...
Saxon-HE (home edition) is an open source product available under the Mozilla Public License. It pro...
JDK 11 java.sql.rowset.jmod is the JMOD file for JDK 11 SQL Rowset module. JDK 11 SQL Rowset module ...