II. Proposed FTP Compressed Data Mode
Byte size is B bits. Figures above boxes are field lengths in bits.
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)
+----------+ +----------+
The control byte "C" which is the second byte of a control escape sequence is to have the same coding as the descriptor byte in Block Mode. This includes end-of-file and end-of-record indications. I will not specify this further because there is some question at present about the exact coding of the Block Mode descriptor byte.
Following the example of APL*, we have let the meaning of the filler (blank or 0) be determined by the type: character (ASCII|EBCDIC) vs. binary (Image|Local Byte). If byte size is equal to the word size of the transmitting host, the compressed mode allows one to send sparse notices with reasonable efficiency.
* Compare 1 (take) 0 1\`A' with 1 (take) 0 1\2