类 ChannelUtil
java.lang.Object
com.weicoder.common.io.ChannelUtil
- 直接已知子类:
I.C
nio通道操作
- 作者:
- WD
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static byte[]读取出通道的所有字节static byte[]read(ReadableByteChannel ch, boolean isClose) 读取出通道的所有字节static intwrite(String file, ByteBuffer src) 写入文件static longwrite(ReadableByteChannel rbc, WritableByteChannel wbc, boolean isClose) 把text写入到os中static longwrite(ReadableByteChannel rbc, WritableByteChannel wbc, int buff, boolean isClose, Calls.EoR<Buffer, Buffer> call) 读取并写入数据static longwrite(ReadableByteChannel rbc, WritableByteChannel wbc, int buff, Calls.EoR<Buffer, Buffer> call) 读取并写入数据 默认不关闭流static longwrite(WritableByteChannel wbc, byte[] b) 把text写入到os中static longwrite(WritableByteChannel wbc, byte[] b, boolean isClose) 把text写入到os中static longwrite(WritableByteChannel wbc, InputStream in) 把text写入到os中static longwrite(WritableByteChannel wbc, InputStream in, boolean isClose) 把text写入到os中
-
构造器详细资料
-
ChannelUtil
public ChannelUtil()
-
-
方法详细资料
-
read
读取出通道的所有字节- 参数:
ch- 通道- 返回:
- 字节数组
-
read
读取出通道的所有字节- 参数:
ch- 通道isClose- 是否关闭流- 返回:
- 字节数组
-
write
把text写入到os中- 参数:
wbc- 写入通道b- 字节数组- 返回:
- true false
-
write
把text写入到os中- 参数:
wbc- 写入通道b- 字节数组isClose- 是否关闭流- 返回:
- true false
-
write
把text写入到os中- 参数:
wbc- 写入通道in- 输入流- 返回:
- true false
-
write
把text写入到os中- 参数:
wbc- 写入通道in- 输入流isClose- 是否关闭流- 返回:
- 写入成功字节数
-
write
写入文件- 参数:
file- 要写入的文件src- 原始数据- 返回:
- 写入字节数
-
write
把text写入到os中- 参数:
rbc- 输入流wbc- 写入通道isClose- 是否关闭流- 返回:
- true false
-
write
public static long write(ReadableByteChannel rbc, WritableByteChannel wbc, int buff, Calls.EoR<Buffer, Buffer> call) 读取并写入数据 默认不关闭流- 参数:
rbc- 读取通道wbc- 写入通道buff- 每次读取缓存熟call- 回调- 返回:
- 读取流总数
-
write
public static long write(ReadableByteChannel rbc, WritableByteChannel wbc, int buff, boolean isClose, Calls.EoR<Buffer, Buffer> call) 读取并写入数据- 参数:
rbc- 读取通道wbc- 写入通道buff- 每次读取缓存数isClose- 是否关闭流call- 回调- 返回:
- 读取流总数
-