Throw exception when trying to seek to negative address

This commit is contained in:
honfika
2014-08-24 09:10:02 +02:00
parent 92c6b365bb
commit c4fa4f4a23

View File

@@ -60,6 +60,9 @@ public class MemoryInputStream extends SeekableInputStream {
@Override
public void seek(long pos) throws IOException {
if (pos < 0) {
throw new IOException("Seek to negative position");
}
this.pos = pos;
}