X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2Futil%2FSeekable.java;h=cacca0a3b9a700b28034c3522d76833b463f1820;hp=bc21a553a2d315c9771b417483ecf94e20d85a6d;hb=6d6d9f59a2e6fe3b9e5b3563efcf0124bea4a672;hpb=bab62978a50dba681e4cbc5e57bfa819d06d49a7 diff --git a/src/org/ibex/nestedvm/util/Seekable.java b/src/org/ibex/nestedvm/util/Seekable.java index bc21a55..cacca0a 100644 --- a/src/org/ibex/nestedvm/util/Seekable.java +++ b/src/org/ibex/nestedvm/util/Seekable.java @@ -13,6 +13,10 @@ public abstract class Seekable { public abstract void seek(int pos) throws IOException; public abstract void close() throws IOException; public abstract int pos() throws IOException; + + public void resize(long length) throws IOException { + throw new IOException("resize not implemented for " + getClass()); + } public int read() throws IOException { byte[] buf = new byte[1]; @@ -83,6 +87,7 @@ public abstract class Seekable { public int pos() throws IOException { return (int) raf.getFilePointer(); } public int length() throws IOException { return (int)raf.length(); } public void close() throws IOException { raf.close(); } + public void resize(long length) throws IOException { raf.setLength(length); } } public static class InputStream extends Seekable {