jxl.read.biff
Class File

java.lang.Object
  extended byjxl.read.biff.File

public class File
extends java.lang.Object

File containing the data from the binary stream


Constructor Summary
File(byte[] d)
          Constructs a file from already defragged binary data.
File(java.io.InputStream is, WorkbookSettings ws)
          Constructs a file from the input stream
 
Method Summary
 void clear()
          Clears the contents of the file
 void close()
          Deprecated. As of version 1.6 use workbook.close() instead
 int getPos()
          Gets the position in the stream
 boolean hasNext()
          Determines if the current position exceeds the end of the file
 byte[] read(int pos, int length)
          Copies the bytes into a new array and returns it.
 void restorePos()
          Restores the original position These methods are used by the SheetImpl.readSheet() when it is reading in all the cell values
 void setPos(int p)
          Saves the current position and temporarily sets the position to be the new one.
 void skip(int bytes)
          Skips forward the specified number of bytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

File

public File(java.io.InputStream is,
            WorkbookSettings ws)
     throws java.io.IOException,
            BiffException
Constructs a file from the input stream

Parameters:
is - the input stream
ws - the workbook settings
Throws:
java.io.IOException
BiffException

File

public File(byte[] d)
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

Parameters:
d - the already parsed data
Method Detail

skip

public void skip(int bytes)
Skips forward the specified number of bytes

Parameters:
bytes - the number of bytes to skip forward

read

public byte[] read(int pos,
                   int length)
Copies the bytes into a new array and returns it.

Parameters:
pos - the position to read from
length - the number of bytes to read
Returns:
The bytes read

getPos

public int getPos()
Gets the position in the stream

Returns:
the position in the stream

setPos

public void setPos(int p)
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

Parameters:
p - the temporary position

restorePos

public void restorePos()
Restores the original position These methods are used by the SheetImpl.readSheet() when it is reading in all the cell values


close

public void close()
Deprecated. As of version 1.6 use workbook.close() instead

"Closes" the biff file


clear

public void clear()
Clears the contents of the file


hasNext

public boolean hasNext()
Determines if the current position exceeds the end of the file

Returns:
TRUE if there is more data left in the array, FALSE otherwise