Class ChannelUtils
java.lang.Object
org.aksw.commons.io.nio.ChannelUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intread(SeekableByteChannel src, ByteBuffer dst, long position) static intreadFully(ReadableByteChannel src, ByteBuffer dst) Method akin to Apache IOUtils.readFully without sanity checkingstatic intreadFully(SeekableByteChannel src, ByteBuffer dst, long srcPosition) Read fully from a src channel at position srcPosition into a dst buffer.static longreadScattered(ReadableByteChannel src, ByteBuffer[] dsts, int offset, int length) static longtransferFrom(SeekableByteChannel dst, ReadableByteChannel src, long position, long count, int blockSize) static longtransferTo(SeekableByteChannel src, long position, long count, WritableByteChannel target, int blockSize) static intwrite(SeekableByteChannel dst, ByteBuffer src, long position) static intwriteFully(WritableByteChannel tgt, ByteBuffer buffer) static longwriteScattered(WritableByteChannel dst, ByteBuffer[] srcs, int offset, int length)
-
Constructor Details
-
ChannelUtils
public ChannelUtils()
-
-
Method Details
-
readFully
public static int readFully(SeekableByteChannel src, ByteBuffer dst, long srcPosition) throws IOException Read fully from a src channel at position srcPosition into a dst buffer. After this method returns src.position is reset to its original value- Throws:
IOException
-
readFully
Method akin to Apache IOUtils.readFully without sanity checking- Throws:
IOException
-
writeFully
- Throws:
IOException
-
read
- Throws:
IOException
-
write
- Throws:
IOException
-
transferTo
public static long transferTo(SeekableByteChannel src, long position, long count, WritableByteChannel target, int blockSize) throws IOException - Throws:
IOException
-
transferFrom
public static long transferFrom(SeekableByteChannel dst, ReadableByteChannel src, long position, long count, int blockSize) throws IOException - Throws:
IOException
-
readScattered
public static long readScattered(ReadableByteChannel src, ByteBuffer[] dsts, int offset, int length) throws IOException - Throws:
IOException
-
writeScattered
public static long writeScattered(WritableByteChannel dst, ByteBuffer[] srcs, int offset, int length) throws IOException - Throws:
IOException
-