mirror of
https://github.com/i2p/i2p.i2p.git
synced 2024-12-06 19:27:00 +01:00
better message on EOF reading data
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user