I want to read a file piece by piece. The file is split up into several pieces which are stored on different types of media. What I currently do is call each seperate piece
Instead of older io you can try nio for reading file chunk by chunk in memory not full file . You can use Channel to get datas from multiple source
RandomAccessFile aFile = new RandomAccessFile(
"test.txt","r");
FileChannel inChannel = aFile.getChannel();
long fileSize = inChannel.size();
ByteBuffer buffer = ByteBuffer.allocate((int) fileSize);
inChannel.read(buffer);
//buffer.rewind();
buffer.flip();
for (int i = 0; i < fileSize; i++)
{
System.out.print((char) buffer.get());
}
inChannel.close();
aFile.close();