albfernandez / javadbf

Java library for reading and writing Xbase (dBase/DBF) files.
GNU Lesser General Public License v3.0
220 stars 98 forks source link

DBFWrite: bug in writing LONG #120

Closed HelmutL closed 7 months ago

HelmutL commented 7 months ago

DBFWrite (downloaded Feb 21) cannot write LONG fields.

in writeRecord() for LONG it should be case LONG: case AUTOINCREMENT: if (objectArray[j] != null) { dataOutput.write(DBFUtils.littleEndianInt(((Number) objectArray[j]).intValue())); } else { dataOutput.write(0); } break;

instead of dataOutput.write(DBFUtils.littleEndian(((Number) objectArray[j]).intValue()));

which writes only one byte instead of four.