跳到主要内容

II. 拟议的 FTP 压缩数据模式

字节大小为 B 比特。方框上方的数字为字段长度(单位:比特)。

                                  n bytes of data
/--------/\--------\
1 B-1 / B B \
+---+------+ +--------+ +--------+
Byte String: | 0 | n | | d |. . .| d |
| | | | 1 | | n |
+---+------+ +--------+ +--------+
String of n data bytes d(1),...,d(n)
Count n must be positive

2 B-2 B
+----+------+ +---------+
Replicated Byte: | 1 0| n | | d |
+----+------+ +---------+
String consisting of n replications of the data byte d

2 B-2
+----+------+
Filler String: | 1 1| n |
+----+------+
String of n filler bytes. The filler byte is a "space"
character for ASCII or EBCDIC type, or a binary zero
byte for Image or Local Byte Type.

B B
+----------+ +----------+
Control Escape Sequence: | 0......0 | | C | (see below)
+----------+ +----------+

控制字节“C”是控制转义序列的第二个字节,其编码应与块模式中的描述符字节相同。这包括文件结束和记录结束的指示。我不再对此做进一步规定,因为目前对块模式描述符字节的确切编码还存在一些疑问。

仿效 APL* 的做法,我们让填充字节(空格或 0)的含义由类型决定:字符型(ASCII|EBCDIC)对二进制型(Image|Local Byte)。如果字节大小等于发送主机的字长,压缩模式就能以相当高的效率发送稀疏通知(sparse notices)。

* Compare 1 (take) 0 1\`A' with 1 (take) 0 1\2