org.archiviststoolkit.importer
Class HandleInputFile

java.lang.Object
  extended by org.archiviststoolkit.importer.HandleInputFile

public class HandleInputFile
extends java.lang.Object


Constructor Summary
HandleInputFile()
           
 
Method Summary
 int getDatalen()
          Returns Datalen
 int getMaxlen()
          Returns Maxlen
 int getNumBytesUsed()
          Returns NumBytesUsed
 int getNumRecordsRead()
          Returns NumRecordsRead
 int getOffset()
          Returns Offset
 int getRecordTagLength()
          Returns RecordTagLength
 void initializeInput(java.io.InputStream inputStream)
          Initializes HandlerObject.
 void initializeInput(java.lang.String inputFileName)
          Initializes HandlerObject.
 byte[] loadRecord(java.lang.String recordTag)
          Loads a record from an input stream into a byte array.
 boolean makesRecords()
           
 float percentDone()
           
 java.lang.String reportStats()
          returns the number of record(s) and bytes converted to(importing) or From(exporting) a DataDir object.
 void setDatalen(int datalen)
          Sets Datalen
 void setMaxlen(int maxlen)
          Sets Maxlen
 void setNumBytesUsed(int numBytesUsed)
          Sets NumBytesUsed
 void setNumRecordsRead(int numRecordsRead)
          Sets NumRecordsRead
 void setOffset(int offset)
          Sets Offset
 void setRecordTagLength(int recordTagLength)
          Sets RecordTagLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandleInputFile

public HandleInputFile()
Method Detail

setDatalen

public void setDatalen(int datalen)
Sets Datalen

Parameters:
Datalen - an int

getDatalen

public int getDatalen()
Returns Datalen

Returns:
an int

setMaxlen

public void setMaxlen(int maxlen)
Sets Maxlen

Parameters:
Maxlen - an int

getMaxlen

public int getMaxlen()
Returns Maxlen

Returns:
an int

setNumBytesUsed

public void setNumBytesUsed(int numBytesUsed)
Sets NumBytesUsed

Parameters:
NumBytesUsed - an int

getNumBytesUsed

public int getNumBytesUsed()
Returns NumBytesUsed

Returns:
an int

setOffset

public void setOffset(int offset)
Sets Offset

Parameters:
Offset - an int

getOffset

public int getOffset()
Returns Offset

Returns:
an int

setRecordTagLength

public void setRecordTagLength(int recordTagLength)
Sets RecordTagLength

Parameters:
RecordTagLength - an int

getRecordTagLength

public int getRecordTagLength()
Returns RecordTagLength

Returns:
an int

setNumRecordsRead

public void setNumRecordsRead(int numRecordsRead)
Sets NumRecordsRead

Parameters:
NumRecordsRead - an int

getNumRecordsRead

public int getNumRecordsRead()
Returns NumRecordsRead

Returns:
an int

initializeInput

public void initializeInput(java.lang.String inputFileName)
                     throws java.io.IOException
Initializes HandlerObject.

Parameters:
inputFileName - the file to read from,
tagsFileName - the tagsFileName
Throws:
java.io.IOException - if error loading or parsing Tags file.
Since:
1.0

initializeInput

public void initializeInput(java.io.InputStream inputStream)
Initializes HandlerObject.

Parameters:
inputStream - the file to read from,
tagsFileName - the tagsFileName
Throws:
java.io.IOException - if error loading or parsing Tags file.
Since:
1.0

loadRecord

public byte[] loadRecord(java.lang.String recordTag)
                  throws java.io.IOException
Loads a record from an input stream into a byte array.

Returns:
a null at normal end-of-file
Throws:
java.io.EOFException - if abnormal end of file .
java.io.IOException
Since:
1.0

percentDone

public float percentDone()

makesRecords

public boolean makesRecords()

reportStats

public java.lang.String reportStats()
returns the number of record(s) and bytes converted to(importing) or From(exporting) a DataDir object.

Returns:
a String message.
Since:
1.0