+ //byte[] tmp = new byte[4096];
+ ByteBuffer tmp = ByteBuffer.allocate(4096);
+ int readResult = 0;
+
+ // TODO(bprzybylski): each mem allocation can throw OutOfMemoryError we need to handle it
+ // globally in some fashionable manner
+ RandomAccessFile raf = new RandomAccessFile(mFile, "rw");
+ FileChannel channel = raf.getChannel();
+ FileLock lock = channel.tryLock();
+ Iterator<OnDatatransferProgressListener> it = null;
+ long transferred = 0;
+ long size = mFile.length();
+ if (size == 0) size = -1;