public JaydioDirectIoChannel(File file) throws IOException { fileChannel = DirectIoByteChannel.getChannel(file, false); fileSize = fileChannel.size(); }
public static DirectIoByteChannel getChannel(File file, boolean readOnly) throws IOException { DirectIoLib lib = DirectIoLib.getLibForPath(file.toString()); return getChannel(lib, file, readOnly); }
public static DirectIoByteChannel getChannel(File file, boolean readOnly) throws IOException { DirectIoLib lib = DirectIoLib.getLibForPath(file.toString()); return getChannel(lib, file, readOnly); }
public static DirectIoByteChannelAligner open(DirectIoLib lib, File path, int bufferSize, boolean readOnly) throws IOException { if (bufferSize < 0 || (bufferSize % lib.blockSize() != 0)) { throw new IllegalArgumentException("The buffer capacity must be a multiple of the file system block size"); } BufferedChannel<AlignedDirectByteBuffer> channel = DirectIoByteChannel.getChannel(lib, path, readOnly); AlignedDirectByteBuffer buffer = AlignedDirectByteBuffer.allocate(lib, bufferSize); return new DirectIoByteChannelAligner(lib, channel, buffer); }
public static DirectIoByteChannelAligner open(DirectIoLib lib, File path, int bufferSize, boolean readOnly) throws IOException { if (bufferSize < 0 || (bufferSize % lib.blockSize() != 0)) { throw new IllegalArgumentException("The buffer capacity must be a multiple of the file system block size"); } BufferedChannel<AlignedDirectByteBuffer> channel = DirectIoByteChannel.getChannel(lib, path, readOnly); AlignedDirectByteBuffer buffer = AlignedDirectByteBuffer.allocate(lib, bufferSize); return new DirectIoByteChannelAligner(lib, channel, buffer); }