@Override public InputStream newInputStream() throws IOException { return new FileChannelInputStream(open("r"), true); }
@Override public InputStream newInputStream() throws IOException { return new FileChannelInputStream(open("r"), true); }
@Override public InputStream newInputStream() { FileNioMemData obj = getMemoryFile(); FileNioMem m = new FileNioMem(obj, true); return new FileChannelInputStream(m, true); }
@Override public InputStream newInputStream() { FileMemData obj = getMemoryFile(); FileMem m = new FileMem(obj, true); return new FileChannelInputStream(m, true); }
private void copy(String fileName, boolean quiet) throws IOException { if (FileUtils.isDirectory(fileName)) { return; } String temp = directory + "/temp.db"; try (FileChannel fileIn = getFileChannel(fileName, "r", decryptKey)){ try(InputStream inStream = new FileChannelInputStream(fileIn, true)) { FileUtils.delete(temp); try (OutputStream outStream = new FileChannelOutputStream(getFileChannel(temp, "rw", encryptKey), true)) { byte[] buffer = new byte[4 * 1024]; long remaining = fileIn.size(); long total = remaining; long time = System.nanoTime(); while (remaining > 0) { if (!quiet && System.nanoTime() - time > TimeUnit.SECONDS.toNanos(1)) { out.println(fileName + ": " + (100 - 100 * remaining / total) + "%"); time = System.nanoTime(); } int len = (int) Math.min(buffer.length, remaining); len = inStream.read(buffer, 0, len); outStream.write(buffer, 0, len); remaining -= len; } } } } FileUtils.delete(fileName); FileUtils.move(temp, fileName); }
public InputStream getInputStream() { FileChannel fc = store.getFileStore().getEncryptedFile(); if (fc == null) { fc = store.getFileStore().getFile(); } return new FileChannelInputStream(fc, false); }
@Override public InputStream newInputStream() throws IOException { return new FileChannelInputStream(open("r"), true); }
@Override public InputStream newInputStream() throws IOException { return new FileChannelInputStream(open("r"), true); }
@Override public InputStream newInputStream() throws IOException { return new FileChannelInputStream(open("r"), true); }
@Override public InputStream newInputStream() throws IOException { return new FileChannelInputStream(open("r"), true); }
@Override public InputStream newInputStream() { FileMemData obj = getMemoryFile(); FileMem m = new FileMem(obj, true); return new FileChannelInputStream(m, true); }
@Override public InputStream newInputStream() { FileNioMemData obj = getMemoryFile(); FileNioMem m = new FileNioMem(obj, true); return new FileChannelInputStream(m, true); }
@Override public InputStream newInputStream() { FileMemData obj = getMemoryFile(); FileMem m = new FileMem(obj, true); return new FileChannelInputStream(m, true); }
@Override public InputStream newInputStream() { FileNioMemData obj = getMemoryFile(); FileNioMem m = new FileNioMem(obj, true); return new FileChannelInputStream(m, true); }
public InputStream getInputStream() { FileChannel fc = store.getFileStore().getEncryptedFile(); if (fc == null) { fc = store.getFileStore().getFile(); } return new FileChannelInputStream(fc, false); }
public InputStream getInputStream() { FileChannel fc = store.getFileStore().getEncryptedFile(); if (fc == null) { fc = store.getFileStore().getFile(); } return new FileChannelInputStream(fc, false); }
fileIn = new FilePathEncrypt.FileEncrypt(fileName, decryptKey, fileIn); InputStream inStream = new FileChannelInputStream(fileIn, true); FileUtils.delete(temp); fileOut = FilePath.get(temp).open("rw");
fileIn = new FilePathEncrypt.FileEncrypt(fileName, decryptKey, fileIn); InputStream inStream = new FileChannelInputStream(fileIn, true); FileUtils.delete(temp); fileOut = FilePath.get(temp).open("rw");