Package hec.io.dbf
Class AbstractDBFHeader
java.lang.Object
hec.io.dbf.AbstractDBFHeader
- All Implemented Interfaces:
DBFHeader
,Serializable
- Direct Known Subclasses:
AsciiSerializableDbfHeader
,DBaseIIIHeader
,DBaseIVHeader
,DBaseIVMemoHeader
This is the base class that represents the header for a DBF file.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List
protected byte[]
This is the byte array that represents the DBF Header from the file on disk.protected int
protected int
protected int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteFieldDescriptor
(int pos) void
deleteFieldDescriptor
(String name) protected void
fillPreHeaderByteArray
(byte[] headerBytes) Creates a copy of header, inserts the new header size, recordSize, and numberRecords and returns the new byte array; Edits only the first 32bytes of databyte[]
Returns the byte array the represents this header fileabstract byte
getFieldDescriptor
(int pos) getFieldDescriptor
(String fieldName) String[]
int
int
int
int
void
insertFieldDescriptor
(DBFFieldDescriptor fd, int pos) protected boolean
boolean
readHeader
(EndianInputStream reader) protected boolean
readPreHeader
(EndianInputStream reader) void
resizeFieldDescriptor
(int newSize, int pos)
-
Field Details
-
FIELD_DESCRIPTOR_SIZE
public static final int FIELD_DESCRIPTOR_SIZE- See Also:
-
FIELD_DESCRIPTOR_OFFSET
public static final int FIELD_DESCRIPTOR_OFFSET- See Also:
-
_header
protected byte[] _headerThis is the byte array that represents the DBF Header from the file on disk. Once it is read it should never be changed. Use getByteArray() to get the current byte information. -
_headerSize
protected int _headerSize -
_recordSize
protected int _recordSize -
_numRecords
protected int _numRecords -
_fieldDescriptors
-
-
Constructor Details
-
AbstractDBFHeader
public AbstractDBFHeader()
-
-
Method Details
-
getHeaderSize
public int getHeaderSize()- Specified by:
getHeaderSize
in interfaceDBFHeader
-
getNumRecords
public int getNumRecords()- Specified by:
getNumRecords
in interfaceDBFHeader
-
getRecordSize
public int getRecordSize()- Specified by:
getRecordSize
in interfaceDBFHeader
-
deleteFieldDescriptor
public void deleteFieldDescriptor(int pos) - Specified by:
deleteFieldDescriptor
in interfaceDBFHeader
-
deleteFieldDescriptor
- Specified by:
deleteFieldDescriptor
in interfaceDBFHeader
-
resizeFieldDescriptor
public void resizeFieldDescriptor(int newSize, int pos) - Specified by:
resizeFieldDescriptor
in interfaceDBFHeader
-
insertFieldDescriptor
- Specified by:
insertFieldDescriptor
in interfaceDBFHeader
-
getFieldDescriptors
- Specified by:
getFieldDescriptors
in interfaceDBFHeader
-
getFieldNames
- Specified by:
getFieldNames
in interfaceDBFHeader
-
getFieldDescriptor
- Specified by:
getFieldDescriptor
in interfaceDBFHeader
-
getFieldDescriptor
- Specified by:
getFieldDescriptor
in interfaceDBFHeader
-
getNumDescriptors
public int getNumDescriptors()- Specified by:
getNumDescriptors
in interfaceDBFHeader
-
readHeader
- Specified by:
readHeader
in interfaceDBFHeader
-
readPreHeader
-
readFieldDescriptors
-
fillPreHeaderByteArray
protected void fillPreHeaderByteArray(byte[] headerBytes) Creates a copy of header, inserts the new header size, recordSize, and numberRecords and returns the new byte array; Edits only the first 32bytes of data -
getDbaseVersionCode
public abstract byte getDbaseVersionCode() -
getByteArray
public byte[] getByteArray()Returns the byte array the represents this header file- Specified by:
getByteArray
in interfaceDBFHeader
-