42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
-
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
* for being overriden in subclasses!
*
* \return A boolean whether the end of the stream has been reached
*/
- (BOOL)atEndOfStreamWithoutCache;
/**
* Reads from the stream into a buffer.
* Reads at most size bytes from the stream into a buffer.
*
* IMPORTANT: Do *NOT* override this in subclasses! Override
* readNBytesWithoutCache:intoBuffer: instead, as otherwise, you *WILL* break
* caching and thus get broken results!
*
* \param buf The buffer into which the data is read
* \param size The size of the data that should be read.
* The buffer MUST be at least size big!
* \param size The size of the data that should be read at most.
* The buffer MUST be at least size big!
* \return The number of bytes read
*/
- (size_t)readNBytes: (size_t)size
intoBuffer: (char*)buf;
/**
* Reads from the stream into a buffer without looking at the cache.
*
* IMPORTANT: Do *NOT* use this! Use readNBytes:intoBuffer: instead, as this is
* *ONLY* for being overriden in subclasses!
*
* \param buf The buffer into which the data is read
* \param size The size of the data that should be read.
* The buffer MUST be at least size big!
* \param size The size of the data that should be read at most.
* The buffer MUST be at least size big!
* \return The number of bytes read
*/
- (size_t)readNBytesWithoutCache: (size_t)size
intoBuffer: (char*)buf;
/**
* Reads exactly size bytes from the stream into a buffer. Unlike
* readNBytes:intoBuffer:, this method does not return when less than the
* specified size has been read - instead, it waits until it got exactly size
* bytes.
*
* \param buf The buffer into which the data is read
* \param size The size of the data that should be read.
* The buffer MUST be EXACTLY this big!
*/
- (void)readExactlyNBytes: (size_t)size
intoBuffer: (char*)buf;
/**
* \return An OFDataArray with an item size of 1 with all the data of the
* stream until the end of the stream is reached.
*/
- (OFDataArray*)readDataArrayTillEndOfStream;
/**
|