@Override public Collection<Collection<Writable>> sequenceRecord() { File next = iter.next(); try{ return loadData(NIOUtils.readableFileChannel(next)); }catch(IOException e){ throw new RuntimeException(e); } }
public static MovieBox createRefMovie(File source) throws IOException { SeekableByteChannel input = null; try { input = readableFileChannel(source); return createRefMovie(input, "file://" + source.getCanonicalPath()); } finally { if (input != null) input.close(); } }
@Override public void reset() { try { grabber = new FrameGrab(NIOUtils.readableFileChannel(new File(filename))); } catch (IOException | JCodecException e) { throw new RuntimeException(e); } try { frameCurrent = null; frameNext = grabber.getNativeFrame(); } catch (IOException e) { frameNext = null; } } }
public static MovieBox createRefMovie(File source) throws IOException { SeekableByteChannel input = null; try { input = readableFileChannel(source); return createRefMovie(input, "file://" + source.getCanonicalPath()); } finally { if (input != null) input.close(); } }
@Override public void reset() { try { grabber = new FrameGrab(NIOUtils.readableFileChannel(new File(filename))); } catch (IOException | JCodecException e) { throw new RuntimeException(e); } try { frameCurrent = null; frameNext = grabber.getNativeFrame(); } catch (IOException e) { frameNext = null; } } }
public static MovieBox parseMovie(File source) throws IOException { SeekableByteChannel input = null; try { input = readableFileChannel(source); return parseMovie(input); } finally { if (input != null) input.close(); } }
public static MovieBox parseMovie(File source) throws IOException { SeekableByteChannel input = null; try { input = readableFileChannel(source); return parseMovie(input); } finally { if (input != null) input.close(); } }
public void readFile(File source, int bufferSize, FileReaderListener listener) throws IOException { ByteBuffer buf = ByteBuffer.allocate(bufferSize); SeekableByteChannel ch = null; try { ch = NIOUtils.readableFileChannel(source); long size = ch.size(); for (long pos = ch.position(); ch.read(buf) != -1; pos = ch.position()) { buf.flip(); data(buf, pos); buf.flip(); if (listener != null) { int newPd = (int) (100 * pos / size); if (newPd != oldPd) listener.progress(newPd); oldPd = newPd; } } } finally { NIOUtils.closeQuietly(ch); } } }
public void readFile(File source, int bufferSize, FileReaderListener listener) throws IOException { ByteBuffer buf = ByteBuffer.allocate(bufferSize); SeekableByteChannel ch = null; try { ch = NIOUtils.readableFileChannel(source); long size = ch.size(); for (long pos = ch.position(); ch.read(buf) != -1; pos = ch.position()) { buf.flip(); data(buf, pos); buf.flip(); if (listener != null) { int newPd = (int) (100 * pos / size); if (newPd != oldPd) listener.progress(newPd); oldPd = newPd; } } } finally { NIOUtils.closeQuietly(ch); } } }
SeekableByteChannel input = NIOUtils.readableFileChannel(file); MP4Demuxer demuxer = new MP4Demuxer(input); videoTrack = demuxer.getVideoTrack();
SeekableByteChannel input = NIOUtils.readableFileChannel(file); MP4Demuxer demuxer = new MP4Demuxer(input); videoTrack = demuxer.getVideoTrack();
seekableByteChannel = new FixedByteBufferSeekableByteChannel(bb); } else { seekableByteChannel = NIOUtils.readableFileChannel(file);