wandermonk
wandermonk

Reputation: 7356

How to split a file in place without using buffers?

I am sure that we can create a Buffer and use BufferedReader to read the file using the read(Buffer buffer) method.

I have been trying to check if in place read is possible and want to understand what are the implications and complexities involved. Also, If this can be done in a multithreaded environment.

Upvotes: 2

Views: 42

Answers (1)

Pavel Molchanov
Pavel Molchanov

Reputation: 2409

NIO (New IO) will allow creating memory mapped files with MappedByteBuffer, see:

https://howtodoinjava.com/java-7/nio/java-nio-2-0-memory-mapped-files-mappedbytebuffer-tutorial/

Upvotes: 2

Related Questions