Updated comment, the methods work with both of course
Added write check in the constructor
Using allocate() instead of allocateDirect() for small files
Added static import for StandardOpenOption