首页 > 编程语言 >20230627 java.nio.channels.SocketChannel

20230627 java.nio.channels.SocketChannel

时间:2023-08-29 17:13:23浏览次数:32  
标签:20230627 java nio register channels SocketChannel

介绍

  • java.nio.channels.SocketChannel
  • public abstract class SocketChannel extends AbstractSelectableChannel implements ByteChannel, ScatteringByteChannel, GatheringByteChannel, NetworkChannel

API

  • open

    • 打开一个套接字通道,并将其连接到远程地址
  • bind

  • connect

  • socket

  • close

  • isOpen

  • isBlocking

  • isConnected

  • isConnectionPending

  • read

  • write

  • register

  • isRegistered

  • validOps

  • getLocalAddress

  • provider

  • keyFor

  • blockingLock

  • configureBlocking

  • register

  • getOption, setOption

  • supportedOptions

  • shutdownInput

  • shutdownOutput

  • finishConnect

  • getRemoteAddress

标签:20230627,java,nio,register,channels,SocketChannel
From: https://www.cnblogs.com/huangwenjie/p/17650388.html

相关文章

  • 20230627 java.nio.channels.Channels
    介绍java.nio.channels.ChannelsAPIstaticnewInputStreamnewOutputStreamnewChannelReadableByteChannelnewChannel(InputStreamin)WritableByteChannelnewChannel(OutputStreamout)newReadernewWriter......
  • 20230626 java.nio.CharBuffer
    介绍java.nio.CharBufferpublicabstractclassCharBufferextendsBufferimplementsComparable,Appendable,CharSequence,Readablechar缓冲区,内部是char[]APIstaticallocate分配wrap包裹publicgetputcompact压缩将缓冲区当前位置(position)与......
  • 20230626 java.nio.ByteBuffer
    介绍java.nio.ByteBufferpublicabstractclassByteBufferextendsBufferimplementsComparable最常用的Buffer子类APIstaticallocateDirect直接使用本地内存,而不是通过JVM堆空间allocatewrappublicgetputcompact压缩将缓冲区当前位置(positi......
  • 20230621 java.nio.Buffer
    介绍java.nio.BufferpublicabstractclassBuffer缓冲区都具有mark,可选的标记,用于重复一个读入或写出操作,默认-1position,读写位置,下一个值将在此进行读写,默认0limit,界限,超过它进行读写是没有意义的capacity,容量,它永远不能改变这些值满足下面的条件:0<=......
  • 20230517 java.nio.file.Path
    介绍java.nio.file.PathpublicinterfacePathextendsComparable<Path>,Iterable<Path>,Watchable不推荐使用Paths工具类,相关方法在Path接口中都有静态方法代表系统相关的文件路径,可用于在文件系统中定位文件表示分层路径此接口的实现是不可变的,线程安全经常和Fi......
  • 20230626 java.util.regex.Pattern
    介绍java.util.regex.PatternpublicfinalclassPatternimplementsjava.io.Serializable正则表达式的编译表示API常量flagUNIX_LINES启用UNIX行模式在多行模式中匹配^和$时,只有\n被识别成行终止符CASE_INSENSITIVE不区分大小写匹配字符时忽略字母的......
  • 20230626 java.util.regex.Matcher
    介绍java.util.regex.MatcherpublicfinalclassMatcherimplementsMatchResult通过解释Pattern对字符序列执行匹配操作的引擎匹配器关联方法Pattern.matchesAPIstaticquoteReplacement转义所有\和$,避免使用replace方法时出现意外java.util.regex.Mat......
  • 20230621 java.io.Reader
    介绍java.io.ReaderpublicabstractclassReaderimplementsReadable,CloseableAPIreadabstractintread(char[]cbuf,intoff,intlen)throwsIOException;唯一的抽象方法intread()throwsIOExceptionintread(char[]cbuf)throwsIOExceptionintrea......
  • 20230621 java.io.OutputStream
    介绍java.io.OutputStreampublicabstractclassOutputStreamimplementsCloseable,FlushableFilterOutputStream是典型的装饰器设计模式,很多子类继承这个类,提供额外的功能protectedOutputStreamout;publicFilterOutputStream(OutputStreamout){this.out=ou......
  • 20230621 java.io.InputStream
    介绍java.io.InputStreampublicabstractclassInputStreamimplementsCloseableFilterInputStream是典型的装饰器设计模式,很多子类继承这个类,提供额外的功能protectedvolatileInputStreamin;protectedFilterInputStream(InputStreamin){this.in=in;}装......