The indexing methods for file streams answer and accept the byte position in the file, not the character position. In contrast, the indexing operations of CLDT
Streams answer and accept character positions in the buffer being streamed over. When file streams are used with single-byte characters exclusively, the character position and byte positions are the same. However, this is not the case when a mixture of single and double-byte characters are used.
When used with file streams, the copyFrom:to:,
position,
position:,
size, and
skip: messages operate based upon byte indexes and sizes,
not character and sizes. The other file stream operations operate in the same manner as the CLDT
Stream protocols. For portability, use the
next and
next: protocols for stream positioning.