[SOLVED] Should be simple.
Im trying to make genuine use of the "seek" method in RandomFileAccess,
Would the getPosistion within this class be a valid marker for the current posistion? (As you may as already geuss Im here because It isnt)
Code :
package org.name.cache;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class EXPOutStream extends DataOutputStream {
private int posistion;
public EXPOutStream(OutputStream out) {
super(out);
}
public int getPosistion() {
return posistion;
}
@Override
public synchronized void write(byte[] b, int off, int len) throws IOException {
super.write(b, off, len);
setPosistion(getPosistion() + len);
}
public void setPosistion(int posistion) {
this.posistion = posistion;
}
}
Anyone know what the correct method would be?