jxl.read.biff
Class File

java.lang.Object
  |
  +--jxl.read.biff.File

public class File
extends java.lang.Object

File containing the data from the binary stream


Field Summary
private  int arrayGrowSize
          The amount to increase the growable array by
private  byte[] data
          The data from the excel 97 file
private  int initialFileSize
          The initial file size
private  int oldPos
          The saved pos
private  int pos
          The current position within the file
private  WorkbookSettings workbookSettings
          The workbook settings
 
Constructor Summary
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
private  void moveToFirstBof()
          Moves to the first bof in the file
(package private)  Record next()
          Returns the next data record and increments the pointer
(package private)  Record peek()
           
 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, registerNatives, toString, wait, wait, wait
 

Field Detail

data

private byte[] data
The data from the excel 97 file

pos

private int pos
The current position within the file

oldPos

private int oldPos
The saved pos

initialFileSize

private int initialFileSize
The initial file size

arrayGrowSize

private int arrayGrowSize
The amount to increase the growable array by

workbookSettings

private WorkbookSettings workbookSettings
The workbook settings
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
Throws:
java.io.IOException -  
BiffException -  
Method Detail

next

Record next()
Returns the next data record and increments the pointer
Returns:
the next data record

peek

Record peek()

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:
pos - 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

moveToFirstBof

private void moveToFirstBof()
Moves to the first bof in the file

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