X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2Futil%2FSeekable.java;h=485d364d2326287f6a3f58ca93ac22c7cc714a1c;hp=9da8d27c942c9594c7e5befc961666c841381cd5;hb=67c7e733423baf297e3a6684eed50af00e2c8255;hpb=00e7b2dcbcd8d28f3e84954704f874a721dd15d3 diff --git a/src/org/ibex/nestedvm/util/Seekable.java b/src/org/ibex/nestedvm/util/Seekable.java index 9da8d27..485d364 100644 --- a/src/org/ibex/nestedvm/util/Seekable.java +++ b/src/org/ibex/nestedvm/util/Seekable.java @@ -14,6 +14,9 @@ public abstract class Seekable { public abstract void close() throws IOException; public abstract int pos() throws IOException; + public void sync() throws IOException { + throw new IOException("sync not implemented for " + getClass()); + } public void resize(long length) throws IOException { throw new IOException("resize not implemented for " + getClass()); } @@ -90,6 +93,7 @@ public abstract class Seekable { public int read(byte[] buf, int offset, int length) throws IOException { return raf.read(buf,offset,length); } public int write(byte[] buf, int offset, int length) throws IOException { raf.write(buf,offset,length); return length; } + public void sync() throws IOException { raf.getFD().sync(); } public void seek(int pos) throws IOException{ raf.seek(pos); } public int pos() throws IOException { return (int) raf.getFilePointer(); } public int length() throws IOException { return (int)raf.length(); }