public int copyTo(String toFilePath, long every) { int c = 0; FileAdapter fa = new FileAdapter(toFilePath); fa.createFile(); byte[] bts = null; long begin = 0; while ((bts = this.getReader(begin, every).readAll()) != null) { c += fa.getWriter().write(bts); begin += bts.length; } fa.close(); return c; }
public Result<Integer> tryCopyTo(String toFilePath) { return tryCopyTo(toFilePath, FileAdapter.m(8)); }
public static ByteWriteParser getByteWriteParser(int size) { FileAdapter fa = new FileAdapter(""); return fa.getByteParserWriter(size); }
public int copyTo(String toFilePath) { return copyTo(toFilePath, FileAdapter.m(8)); }
public static ByteReadParser getByteReadParser(byte[] array) { if (array == null) array = new byte[0]; FileAdapter fa = new FileAdapter(""); fa.mbread = ByteBuffer.wrap(array); return fa.getReader(Long.MIN_VALUE, Long.MAX_VALUE); }