public class LEOFile extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
actualOutput |
static boolean |
DEBUG |
int |
DEBUGLEVEL |
static int |
IDXBLOCKSIZE |
static int |
MAXDIFATLEN |
| Constructor and Description |
|---|
LEOFile() |
LEOFile(ByteBuffer bytebuff)
a new LEO file containing LEO archive entries
|
LEOFile(File fx) |
LEOFile(File fpath,
boolean usetempfile)
a new LEO file containing LEO archive entries
|
LEOFile(File fpath,
boolean usetempfile,
boolean encryptedXLSX)
Instantiate a Leo file from an encrypted document.
|
LEOFile(File fpath,
int DEBUGLEVEL)
a new LEO file containing LEO archive entries
|
LEOFile(InputStream stream)
Create a LEOFile from an input stream.
|
LEOFile(String fname)
a new LEO file containing LEO archive entries
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkIsLEO(byte[] data,
int count)
Checks whether the given byte array starts with the LEO magic number.
|
void |
clearAfterInit() |
void |
close()
Close the underlying IO streams for this LEOFile.
|
void |
closefb()
just closes the filebuffer withut clearing out buffers and storage tables
|
Storage[] |
getAllDirectories()
get all Directories in this LEO file
|
static byte[] |
getBytes(Block[] outblocks) |
static void |
getBytes(Block[] outblocks,
OutputStream out)
Call this method for each storage, root storage first...
|
static byte[] |
getBytes(List bbvect)
return the bytes for the blocks in a vector
|
static void |
getBytes(List outblocks,
OutputStream out)
Call this method for each storage, root storage first...
|
static OutputStream |
getByteStream(Block[] outblocks) |
static OutputStream |
getByteStream(List bbvect)
return the bytes for the blocks in a vector
|
StorageTable |
getDirectoryArray()
return the Directory Array for this LEOFile
holds all directories (storages and streams) in correct order Directories in turn can reference streams of data |
BlockByteReader |
getDocBlockBytes()
get the bytes of the DOC file.
|
byte[] |
getEncryptionStorageOverage() |
String |
getFileName() |
LEOHeader |
getHeader() |
int |
getMinBlocks()
Get the minimum blocks that this file can encompass
|
static int |
getSizeInBlocks(int sz,
int blocksize)
get the number of Block records
that this Storage needs to store its byte array
|
Storage |
getStorageByName(String s)
get a handle to a Storage within this LEO file
|
BlockByteReader |
getXLSBlockBytes()
get the bytes of the XLS file.
|
boolean |
hasDoc()
return whether the LEOFile contains a valid doc
|
boolean |
hasPivotCache()
return whether the LEOFile contains the _SX_DB_CUR Pivot Table Cache storage (required for Pivot Table)
|
boolean |
hasWorkBook()
return whether the LEOFile contains a valid workbook
|
int[] |
init(ByteBuffer bbuf)
read LEO file information from header.
|
void |
initWrapper(ByteBuffer bytebuff)
This is just removing some duplicate code from our constructors
We should add some exception handling in here!
|
void |
readEncryptedFile(File encryptedFile)
Reads in an encrypted LEO stream.
|
static int[] |
readFAT(List vect)
returns the table of int locations
in the file for the BIGBLOCK linked list.
|
static FileBuffer |
readFile(File fpath)
create a FileBuffer from a file, use system property to determine
whether to use a temp file.
|
static FileBuffer |
readFile(File fpath,
boolean usetempfile)
create a FileBuffer from a file, use boolean parameter to determine
whether to use a temp file.
|
static FileBuffer |
readFile(String fpath)
read in a WorkBook ByteBuffer from a file path.
|
void |
shutdown() |
List |
writeBytes(OutputStream out,
int workbook_byte_size)
Creates all the necessary headers and associated storages/structures that,
along with the actual workbook data, makes up the document
Basic Structure
1st sector or block= Header + 1st 109 sector chains (==FAT===array of sector numbers)
Location of FAT==DIFAT
Header denotes sector of "Root Directory" which in turn denotes sectors of all other directories
(Workbook is but one of several directories)
Each directory denotes the start block of any associated data into the FAT (sector chain index)
(if directory is >0 an <4096 in size, it's associated data is stored in miniStorage
Ok, so this is a little odd, it looks as if it collects all of the storages, and handles
all of the preprocessing necessary to create FAT etc.
|
public static final int MAXDIFATLEN
public static final int IDXBLOCKSIZE
public static final boolean DEBUG
public int DEBUGLEVEL
public static int actualOutput
public LEOFile(String fname)
String - a file path containing a valid LEOfilepublic LEOFile(File fpath, boolean usetempfile, boolean encryptedXLSX)
a - file containing a valid LEOfile (XLS BIFF8)whether - to use a temp fileif - the file is encrypted xlsx formatpublic LEOFile(File fpath, boolean usetempfile)
a - file containing a valid LEOfile (XLS BIFF8)whether - to use a temp filepublic LEOFile(File fpath, int DEBUGLEVEL)
a - file containing a valid LEOfile (XLS BIFF8)public LEOFile(ByteBuffer bytebuff)
byte[] - a byte array containing a valid LEOfilepublic LEOFile()
public LEOFile(InputStream stream) throws IOException
stream - IOExceptionpublic LEOFile(File fx)
public LEOHeader getHeader()
public void close()
throws IOException
ExceptionIOExceptionpublic void closefb()
throws IOException
IOExceptionpublic void shutdown()
public static boolean checkIsLEO(byte[] data,
int count)
public void initWrapper(ByteBuffer bytebuff)
public void clearAfterInit()
public void readEncryptedFile(File encryptedFile)
encryptedFile - public String getFileName()
public boolean hasWorkBook()
public boolean hasDoc()
public boolean hasPivotCache()
public List writeBytes(OutputStream out, int workbook_byte_size)
outputstream - to write outbook - to writebook - bytes sizepublic Storage getStorageByName(String s) throws StorageNotFoundException
StorageNotFoundExceptionpublic Storage[] getAllDirectories()
public StorageTable getDirectoryArray()
public BlockByteReader getDocBlockBytes()
public BlockByteReader getXLSBlockBytes()
public int[] init(ByteBuffer bbuf)
public static final FileBuffer readFile(File fpath)
file - containing XLS bytesfpath - public static final FileBuffer readFile(File fpath, boolean usetempfile)
file - containing XLS byteswhether - to use a tempfilepublic static final FileBuffer readFile(String fpath)
public static final int[] readFAT(List vect)
public static final byte[] getBytes(Block[] outblocks)
public static final OutputStream getByteStream(Block[] outblocks)
public static final void getBytes(Block[] outblocks, OutputStream out)
outblocks - out - public static final void getBytes(List outblocks, OutputStream out)
outblocks - out - public static final byte[] getBytes(List bbvect)
public static final OutputStream getByteStream(List bbvect)
public static final int getSizeInBlocks(int sz,
int blocksize)
public int getMinBlocks()
public byte[] getEncryptionStorageOverage()
Copyright © 2002–2019 Starter Inc.. All rights reserved.