public static AutoFileChannelWrapper autoChannel(File file) throws IOException { return new AutoFileChannelWrapper(file); }
@Override public long position() throws IOException { ensureOpen(); return ch.position(); }
@Override public void setCurTime(long curTime) { this.curTime = curTime; if (ch != null && ch.isOpen() && curTime - accessTime > THRESHOLD) { try { close(); } catch (IOException e) { throw new RuntimeException(e); } } } }
@Override public void setCurTime(long curTime) { this.curTime = curTime; if (ch != null && ch.isOpen() && curTime - accessTime > THRESHOLD) { try { close(); } catch (IOException e) { throw new RuntimeException(e); } } } }
@Override public long size() throws IOException { ensureOpen(); return ch.size(); }
public static AutoFileChannelWrapper autoChannel(File file) throws IOException { return new AutoFileChannelWrapper(file); }
@Override public void setCurTime(long curTime) { this.curTime = curTime; if (ch != null && ch.isOpen() && curTime - accessTime > THRESHOLD) { try { close(); } catch (IOException e) { throw new RuntimeException(e); } } } }
@Override public long position() throws IOException { ensureOpen(); return ch.position(); }
public static AutoFileChannelWrapper autoChannel(File file) throws IOException { return new AutoFileChannelWrapper(file); }
@Override public SeekableByteChannel position(long newPosition) throws IOException { ensureOpen(); ch.position(newPosition); savedPos = newPosition; return this; }
public static Atom findFirstAtomInFile(String fourcc, File input) throws IOException { SeekableByteChannel c = new AutoFileChannelWrapper(input); try { return findFirstAtom(fourcc, c); } finally { IOUtils.closeQuietly(c); } }
@Override public SeekableByteChannel setPosition(long newPosition) throws IOException { ensureOpen(); ch.position(newPosition); savedPos = newPosition; return this; }
@Override public int read(ByteBuffer arg0) throws IOException { ensureOpen(); int r = ch.read(arg0); savedPos = ch.position(); return r; }
@Override public long size() throws IOException { ensureOpen(); return ch.size(); }
@Override public SeekableByteChannel position(long newPosition) throws IOException { ensureOpen(); ch.position(newPosition); savedPos = newPosition; return this; }
@Override public long size() throws IOException { ensureOpen(); return ch.size(); }
@Override public long position() throws IOException { ensureOpen(); return ch.position(); }
@Override public SeekableByteChannel truncate(long size) throws IOException { ensureOpen(); ch.truncate(size); savedPos = ch.position(); return this; }
@Override public SeekableByteChannel truncate(long size) throws IOException { ensureOpen(); ch.truncate(size); savedPos = ch.position(); return this; }
@Override public int read(ByteBuffer arg0) throws IOException { ensureOpen(); int r = ch.read(arg0); savedPos = ch.position(); return r; }