public class DBFReader extends FormatReader<DBFHeader>
DBFReader cannot write anythng to a DBF file. For creating DBF files use DBFWriter.
Fetching rocord is possible only in the forward direction and cannot re-wound. In such situation, a suggested approach is to reconstruct the object.
The nextRecord() method returns an array of Objects and the types of these Object are as follows:
xBase Type | Java Type |
---|---|
C | String |
N | Integer |
F | Double |
L | Boolean |
D | java.util.Date |
Modifier and Type | Field and Description |
---|---|
protected java.io.DataInputStream |
dataInputStream |
Constructor and Description |
---|
DBFReader(java.lang.String filename)
Initializes a DBFReader object.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.lang.String |
getCharactersetName() |
DBFField |
getField(int index)
Returns the asked Field.
|
java.lang.Object[] |
nextRecord(int skipThisNumberOfLines)
Reads the returns the next row in the DBF stream.
|
void |
setCharactersetName(java.lang.String characterSetName) |
java.lang.String |
toString() |
createFormatReader, getFieldCount, getFilename, getHeader, getRecordCount, isSystemResource, nextRecord, openStream, setFormatHeader
public DBFReader(java.lang.String filename) throws java.io.IOException
filename
- the filename where the data is read from.java.io.IOException
public java.lang.String getCharactersetName()
public void setCharactersetName(java.lang.String characterSetName)
public java.lang.String toString()
toString
in class java.lang.Object
public DBFField getField(int index)
getField
in class FormatReader<DBFHeader>
index
- Index of the field. Index of the first field is zero.public java.lang.Object[] nextRecord(int skipThisNumberOfLines) throws DBFException
nextRecord
in class FormatReader<DBFHeader>
skipThisNumberOfLines
- the number of lines to skip before reading the observationDBFException
public void close()