better message on EOF reading data

This commit is contained in:
zzz
2014-09-04 15:21:03 +00:00
parent 86935f10a8
commit 0f1036b0e1

View File

@ -81,7 +81,9 @@ public abstract class SimpleDataStructure extends DataStructureImpl {
int length = length();
_data = new byte[length];
int read = read(in, _data);
if (read != length) throw new DataFormatException("Not enough bytes to read the data");
if (read != length)
throw new DataFormatException("EOF reading " + getClass().getSimpleName() +
", read: " + read + ", required: " + length);
}
public void writeBytes(OutputStream out) throws DataFormatException, IOException {