Package com.sshtools.vfs2nio
Class ChannelUtils
java.lang.Object
com.sshtools.vfs2nio.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 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
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
-