diff --git a/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/HelperGeneric.java b/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/HelperGeneric.java index 64b1946e..fc49beb7 100644 --- a/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/HelperGeneric.java +++ b/android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/HelperGeneric.java @@ -65,6 +65,7 @@ import java.io.BufferedInputStream; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.RandomAccessFile; @@ -1985,7 +1986,7 @@ public void run() static byte[] read_chunk_from_SD_file(String file_name_with_path, long position, long file_chunk_length, boolean real_file_path) { - byte[] out = new byte[(int) file_chunk_length]; + final byte[] out = new byte[(int) file_chunk_length]; if (real_file_path) { @@ -1996,11 +1997,7 @@ static byte[] read_chunk_from_SD_file(String file_name_with_path, long position, MappedByteBuffer buffer = inChannel.map(FileChannel.MapMode.READ_ONLY, position, file_chunk_length); // Log.i(TAG, "read_chunk_from_SD_file:" + buffer.limit() + " <-> " + file_chunk_length); - - for (int i = 0; i < buffer.limit(); i++) - { - out[i] = buffer.get(); - } + buffer.get(out); try {