Skip to content

Commit

Permalink
do not read byte for byte
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Oct 15, 2024
1 parent 4ebd288 commit 7c5f99c
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand All @@ -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
{
Expand Down

0 comments on commit 7c5f99c

Please sign in to comment.