public class DDFModule extends java.lang.Object implements DDFConstants
Modifier and Type | Field and Description |
---|---|
protected byte |
_appIndicator |
protected java.lang.String |
_extendedCharSet |
protected int |
_fieldAreaStart |
protected int |
_fieldControlLength |
protected byte |
_inlineCodeExtensionIndicator |
protected byte |
_interchangeLevel |
protected byte |
_leaderIden |
protected int |
_recLength |
protected int |
_sizeFieldLength |
protected int |
_sizeFieldPos |
protected int |
_sizeFieldTag |
protected byte |
_versionNumber |
protected java.lang.String |
fileName |
protected BinaryFile |
fpDDF |
protected long |
nFirstRecordOffset |
protected java.util.Vector |
paoFieldDefns |
protected DDFRecord |
poRecord |
DDF_FIELD_TERMINATOR, DDF_LEADER_SIZE, DDF_UNIT_TERMINATOR
Constructor and Description |
---|
DDFModule()
The constructor.
|
DDFModule(java.lang.String ddfName) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close an ISO 8211 file.
|
void |
destroy()
Clean up, get rid of data and close file pointer.
|
java.lang.String |
dump() |
DDFFieldDefinition |
findFieldDefn(java.lang.String pszFieldName)
Fetch the definition of the named field.
|
DDFFieldDefinition |
getField(int i)
Fetch a field definition by index.
|
BinaryFile |
open(java.lang.String pszFilename)
Open a ISO 8211 (DDF) file for reading, and read the DDR record
to build the field definitions.
|
int |
read()
Convenience method to read a byte from the data file.
|
int |
read(byte[] toData,
int offset,
int length)
Method for other components to call to get the DDFModule to
read bytes into the provided array.
|
DDFRecord |
readRecord()
Read one record from the file, and return to the application.
|
void |
reopen() |
void |
rewind(long nOffset)
Return to first record.
|
void |
seek(long pos)
Convenience method to seek to a location in the data file.
|
java.lang.String |
toString()
Write out module info to debugging file.
|
protected BinaryFile fpDDF
protected java.lang.String fileName
protected long nFirstRecordOffset
protected byte _interchangeLevel
protected byte _inlineCodeExtensionIndicator
protected byte _versionNumber
protected byte _appIndicator
protected int _fieldControlLength
protected java.lang.String _extendedCharSet
protected int _recLength
protected byte _leaderIden
protected int _fieldAreaStart
protected int _sizeFieldLength
protected int _sizeFieldPos
protected int _sizeFieldTag
protected java.util.Vector paoFieldDefns
protected DDFRecord poRecord
public DDFModule()
public DDFModule(java.lang.String ddfName) throws java.io.IOException
java.io.IOException
public void close()
public void destroy()
public BinaryFile open(java.lang.String pszFilename) throws java.io.IOException
pszFilename
- The name of the file to open.java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String dump()
public DDFFieldDefinition findFieldDefn(java.lang.String pszFieldName)
pszFieldName
- The name of the field to search for. The
comparison is case insensitive.public DDFRecord readRecord()
public int read(byte[] toData, int offset, int length)
toData
- the bytes to put data into.offset
- the byte offset to start reading from, whereever
the pointer currently is.length
- the number of bytes to read.public int read()
public void seek(long pos) throws java.io.IOException
pos
- the byte position to reposition the file pointer to.java.io.IOException
public DDFFieldDefinition getField(int i)
i
- (from 0 to GetFieldCount() - 1.public void rewind(long nOffset) throws java.io.IOException
nOffset
- the offset in the file to return to. By default
this is -1, a special value indicating that reading
should return to the first data record. Otherwise it is
an absolute byte offset in the file.java.io.IOException
public void reopen()
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details