Take a look at the following. The file is created, but it can be as close to yours as possible.
MappedByteBuffer MappedByteBuffer.load() FileChannel FileChannel.map()
Here is a snippet to try to get started.
filePipe = new File(tempDirectory, namedPipe.getName() + ".pipe"); try { int pipeSize = 4096; randomAccessFile = new RandomAccessFile(filePipe, "rw"); fileChannel = randomAccessFile.getChannel(); mappedByteBuffer = fileChannel.map(FileChannel.MapMode.READ_WRITE, 0, pipeSize); mappedByteBuffer.load(); } catch (Exception e) { ...
source share