<author email="javajedi@users.sf.net">Tim McCune</author>
</properties>
<body>
+ <release version="2.1.2" date="TBD">
+ <action dev="jahlborn" type="fix" system="SourceForge2" issue="125">
+ Handle reading null calculated values.
+ </action>
+ </release>
<release version="2.1.1" date="2015-05-14">
<action dev="jahlborn" type="fix" system="SourceForge2" issue="123">
Load linked table info from system table when reading databases with
@Override
public Object read(byte[] data, ByteOrder order) throws IOException {
- return super.read(unwrapCalculatedValue(data), order);
+ data = unwrapCalculatedValue(data);
+ if((data.length == 0) && !getType().isVariableLength()) {
+ // apparently "null" values can be written as actual data
+ return null;
+ }
+ return super.read(data, order);
}
@Override
@Override
public Object read(byte[] data, ByteOrder order) throws IOException {
data = unwrapCalculatedValue(data);
+ if(data.length == 0) {
+ return Boolean.FALSE;
+ }
return ((data[0] != 0) ? Boolean.TRUE : Boolean.FALSE);
}
@Override
public Object read(byte[] data, ByteOrder order) throws IOException {
data = unwrapCalculatedValue(data);
+ if(data.length == 0) {
+ // apparently "null" values can be written as actual data
+ return null;
+ }
return readCalcNumericValue(ByteBuffer.wrap(data).order(order));
}