Class AsynChannelUtil

  • Direct Known Subclasses:
    U.AC

    public class AsynChannelUtil
    extends java.lang.Object
    aio读写字节流
    Author:
    wudi
    • Constructor Summary

      Constructors 
      Constructor Description
      AsynChannelUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] read​(java.nio.channels.AsynchronousByteChannel asc)
      读取出通道的所有字节
      static byte[] read​(java.nio.channels.AsynchronousByteChannel asc, boolean isClose)
      读取出通道的所有字节
      static int write​(java.nio.channels.AsynchronousByteChannel asc, byte[] b)
      把字节流写入到aio中
      static int write​(java.nio.channels.AsynchronousByteChannel asc, byte[] b, boolean isClose)
      把字节流写入到aio中
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AsynChannelUtil

        public AsynChannelUtil()
    • Method Detail

      • read

        public static byte[] read​(java.nio.channels.AsynchronousByteChannel asc)
        读取出通道的所有字节
        Parameters:
        asc - 通道
        Returns:
        字节数组
      • read

        public static byte[] read​(java.nio.channels.AsynchronousByteChannel asc,
                                  boolean isClose)
        读取出通道的所有字节
        Parameters:
        asc - 通道
        isClose - 是否关闭流
        Returns:
        字节数组
      • write

        public static int write​(java.nio.channels.AsynchronousByteChannel asc,
                                byte[] b)
        把字节流写入到aio中
        Parameters:
        asc - 写入通道
        b - 字节数组
        Returns:
        true false
      • write

        public static int write​(java.nio.channels.AsynchronousByteChannel asc,
                                byte[] b,
                                boolean isClose)
        把字节流写入到aio中
        Parameters:
        asc - 写入通道
        b - 字节数组
        isClose - 是否关闭流
        Returns:
        true false