mirror of
https://gitee.com/gaohongy/Java-Book.git
synced 2026-07-16 10:33:49 +00:00
修正错误
This commit is contained in:
+2
-2
@@ -10,8 +10,8 @@
|
||||
在上图中,`Side_A`和`Side_B`分别代表通讯系统的两个端点,如果这两个端点要实现通讯,最简单的方式需要实现两个函数:
|
||||
|
||||
```java
|
||||
public byte[] read(){...}; // 读取
|
||||
public void[] write(byte buf[]){...} // 写入
|
||||
public byte[] read(){...}; // 读取
|
||||
public void write(byte buf[]){...}; // 写入
|
||||
```
|
||||
|
||||
这里无论是读取还是写入都使用到一个最基本的结构-字节数组;因为在计算机中,字节是处理数据的基本单位。当然,我们没有考虑到实际通讯当中的复杂性,例如:连接、断开、错误处理等等。但是这两个基本的函数可以是我们通讯的基础。
|
||||
|
||||
Reference in New Issue
Block a user