public final class BinaryUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
readBuffer(java.nio.channels.ReadableByteChannel chan,
java.nio.ByteBuffer buf)
Read a buffer completely from a channel.
|
static void |
writeBuffer(java.nio.channels.WritableByteChannel chan,
java.nio.ByteBuffer buf)
Write a buffer completely to the channel.
|
public static void readBuffer(java.nio.channels.ReadableByteChannel chan, java.nio.ByteBuffer buf) throws java.io.IOException
chan
- The channel.buf
- The buffer.java.io.IOException
- If an error occurs while read the buffer.public static void writeBuffer(java.nio.channels.WritableByteChannel chan, java.nio.ByteBuffer buf) throws java.io.IOException
buf
- The buffer.java.io.IOException
- If an error occurs while writing the buffer.