|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.labs.minion.util.ChannelUtil
public class ChannelUtil
| Field Summary | |
|---|---|
protected static int |
BLOCK_SIZE
The block size in which buffers will be written. |
protected static java.lang.String |
logTag
|
| Constructor Summary | |
|---|---|
ChannelUtil()
|
|
| Method Summary | |
|---|---|
static java.nio.ByteBuffer |
readFully(java.nio.channels.FileChannel c,
long off,
java.nio.ByteBuffer b)
Reads a byte buffer fully from the given channel at the given position, retrying if necessary. |
static java.nio.ByteBuffer |
readFully(java.nio.channels.ReadableByteChannel c,
java.nio.ByteBuffer b)
Reads a byte buffer fully from the given channel, retrying if necessary. |
static void |
transferFully(java.nio.channels.FileChannel src,
java.nio.channels.FileChannel dst)
Transfers the complete content of a channel to another, making sure that all data is written. |
static void |
transferFully(java.nio.channels.FileChannel src,
long position,
long count,
java.nio.channels.FileChannel dst)
Transfers a portion of the content of one channel to another, making sure that all data is written. |
static void |
writeFully(java.nio.channels.GatheringByteChannel c,
java.nio.ByteBuffer[] b,
long size)
Writes an array of byte buffers fully to the given channel. |
static void |
writeFully(java.nio.channels.WritableByteChannel c,
java.nio.ByteBuffer b)
Writes a byte buffer fully to the given channel. |
protected static int |
writeFullyInternal(java.nio.channels.WritableByteChannel c,
java.nio.ByteBuffer b)
Writes a byte buffer fully to the given channel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.lang.String logTag
protected static final int BLOCK_SIZE
| Constructor Detail |
|---|
public ChannelUtil()
| Method Detail |
|---|
public static void writeFully(java.nio.channels.WritableByteChannel c,
java.nio.ByteBuffer b)
throws java.io.IOException
c - The channel that we will write to.b - The buffer we wish to write.
java.io.IOException - If there is any error during writing.
public static void writeFully(java.nio.channels.GatheringByteChannel c,
java.nio.ByteBuffer[] b,
long size)
throws java.io.IOException
size - The number of bytes to write to the channels.c - The channel that we will write to.b - The buffer we wish to write.
java.io.IOException - If there is any error during writing.
protected static int writeFullyInternal(java.nio.channels.WritableByteChannel c,
java.nio.ByteBuffer b)
throws java.io.IOException
c - The channel that we will write to.b - The buffer we wish to write.
java.io.IOException - If there is any error during writing.
public static java.nio.ByteBuffer readFully(java.nio.channels.ReadableByteChannel c,
java.nio.ByteBuffer b)
throws java.io.IOException
c - The channel that we will write to.b - The buffer we wish to write.
java.io.IOException - If there is any error during reading.
public static java.nio.ByteBuffer readFully(java.nio.channels.FileChannel c,
long off,
java.nio.ByteBuffer b)
throws java.io.IOException
c - The channel that we will write to.off - The offset to read from.b - The buffer we wish to write.
java.io.IOException - If there is any error during reading.
public static void transferFully(java.nio.channels.FileChannel src,
java.nio.channels.FileChannel dst)
throws java.io.IOException
src - The source channel.dst - The destination channel.
java.io.IOException - If there is any error transferring the data.
public static void transferFully(java.nio.channels.FileChannel src,
long position,
long count,
java.nio.channels.FileChannel dst)
throws java.io.IOException
src - The source channel.position - The position in the source channel.count - The number of bytes to transfer.dst - The destination channel.
java.io.IOException - If there is any error transferring the data.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||