public interface Connection extends Closeable
表示一个客户端与服务端的连接,负责连接的管理
2020-02-03 16:39
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
关闭连接
|
Charset |
getCharset()
获取字符集
|
InputStream |
getInputStream()
获取输入流
|
OutputStream |
getOutputStream()
获取输出流
|
boolean |
isClosed()
连接是否关闭
|
boolean |
isValid()
测试连接是否有效
|
void close()
close 在接口中 AutoCloseableclose 在接口中 Closeableboolean isClosed()
boolean isValid()
OutputStream getOutputStream() throws IOException
IOException - 操作异常InputStream getInputStream() throws IOException
IOException - 获取输入流错误Charset getCharset()
Copyright © 2021. All rights reserved.