Skip to content

Commit

Permalink
Better method names
Browse files Browse the repository at this point in the history
  • Loading branch information
albfernandez committed Jan 19, 2024
1 parent c3c0ce9 commit 5e01830
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/com/linuxense/javadbf/DBFReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,13 @@ protected Object getFieldValue(DBFField field) throws IOException {
return readMemoField(field);
case BINARY:
if (field.getLength() == 8) {
return readDoubleField_B(field);
return readDoubleFieldLittleEndian(field);
}
else {
return readMemoField(field);
}
case DOUBLE:
return readDoubleField_O(field);
return readDoubleFieldBigEndian(field);
case NULL_FLAGS:
byte [] data1 = new byte[field.getLength()];
this.dataInputStream.readFully(data1);
Expand All @@ -503,16 +503,14 @@ protected Object getFieldValue(DBFField field) throws IOException {
}
}

private Object readDoubleField_B(DBFField field) throws IOException {
private Object readDoubleFieldLittleEndian(DBFField field) throws IOException {
byte[] data = new byte[field.getLength()];
// return this.dataInputStream.readDouble();
this.dataInputStream.readFully(data);
return DBFUtils.toDoubleLittleEndian(data);
}

private Object readDoubleField_O(DBFField field) throws IOException {
private Object readDoubleFieldBigEndian(DBFField field) throws IOException {
byte[] data = new byte[field.getLength()];
// return this.dataInputStream.readDouble();
this.dataInputStream.readFully(data);
return DBFUtils.toDoubleBigEndian(data);
}
Expand Down

0 comments on commit 5e01830

Please sign in to comment.