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 Listprotected byte[]This is the byte array that represents the DBF Header from the file on disk.protected intprotected intprotected intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteFieldDescriptor(int pos) voiddeleteFieldDescriptor(String name) protected voidfillPreHeaderByteArray(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 bytegetFieldDescriptor(int pos) getFieldDescriptor(String fieldName) String[]intintintintvoidinsertFieldDescriptor(DBFFieldDescriptor fd, int pos) protected booleanbooleanreadHeader(EndianInputStream reader) protected booleanreadPreHeader(EndianInputStream reader) voidresizeFieldDescriptor(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:
getHeaderSizein interfaceDBFHeader
-
getNumRecords
public int getNumRecords()- Specified by:
getNumRecordsin interfaceDBFHeader
-
getRecordSize
public int getRecordSize()- Specified by:
getRecordSizein interfaceDBFHeader
-
deleteFieldDescriptor
public void deleteFieldDescriptor(int pos) - Specified by:
deleteFieldDescriptorin interfaceDBFHeader
-
deleteFieldDescriptor
- Specified by:
deleteFieldDescriptorin interfaceDBFHeader
-
resizeFieldDescriptor
public void resizeFieldDescriptor(int newSize, int pos) - Specified by:
resizeFieldDescriptorin interfaceDBFHeader
-
insertFieldDescriptor
- Specified by:
insertFieldDescriptorin interfaceDBFHeader
-
getFieldDescriptors
- Specified by:
getFieldDescriptorsin interfaceDBFHeader
-
getFieldNames
- Specified by:
getFieldNamesin interfaceDBFHeader
-
getFieldDescriptor
- Specified by:
getFieldDescriptorin interfaceDBFHeader
-
getFieldDescriptor
- Specified by:
getFieldDescriptorin interfaceDBFHeader
-
getNumDescriptors
public int getNumDescriptors()- Specified by:
getNumDescriptorsin interfaceDBFHeader
-
readHeader
- Specified by:
readHeaderin 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:
getByteArrayin interfaceDBFHeader
-