How can I seek (change the position) of a ByteArrayInputStream (java.io)? It is something so obvious, but I can\'t seem to find a method for this a
ByteArrayInputStream
java.io
You'd use reset()/skip(). I can't say it's the nicest API in the world, but it should work:
reset()
skip()
public void seek(ByteArrayInputStream input, int position) throws IOException { input.reset(); input.skip(position); }
Of course, that assumes that no-one has called mark().
mark()