tags:

views:

48

answers:

1

I'm considering porting an application from Java to .NET. This application makes a massive use of the NIO package which is totally non-existing in .NET.

One of the crucial differences, which is difficult to replicate on .NET, is the MappedBytesBuffer, since it is used to access an isolated portion of a file.

Could anyone help me finding out an alternative to replicate the functions? Thank you a lot.

+3  A: 

If you can wait until .net 4.0, this might be useful: What's New in the BCL in .net 4.0

Alternatively, you could roll your own wrapper for the Win32 apis CreateFileMapping and MapViewOfFile

marklam
your answer is right to the point and would fix the problem, although some conditions are not satisfied.In fact, the target application should run on Mono under Linux OSs, which are not covering (naturally) the Win32 apis and won't cover the 4.0 functionalities in short time...
Antonello
Maybe your wrapper could test for Mono (assuming you'll be using the MS runtime on Windows) and dllimport the appropriate *nix apis?
marklam