17 #ifndef __STDC_LIMIT_MACROS
18 # define __STDC_LIMIT_MACROS
20 #ifndef __STDC_CONSTANT_MACROS
21 # define __STDC_CONSTANT_MACROS
34 typedef BOOL (^of_stream_async_read_block_t)(
OFStream*,
void*, size_t,
61 size_t cacheLength, writeBufferLength;
64 BOOL waitingForDelimiter;
67 #ifdef OF_HAVE_PROPERTIES
68 @property (getter=isBlocking) BOOL blocking;
69 @property (readonly, getter=isAtEndOfStream) BOOL atEndOfStream;
77 - (BOOL)isAtEndOfStream;
93 - (size_t)readIntoBuffer: (
void*)buffer
111 - (void)readIntoBuffer: (
void*)buffer
112 exactLength: (
size_t)length;
138 - (void)asyncReadIntoBuffer: (
void*)buffer
139 length: (
size_t)length
141 selector: (
SEL)selector;
165 - (void)asyncReadIntoBuffer: (
void*)buffer
166 exactLength: (
size_t)length
168 selector: (
SEL)selector;
170 #ifdef OF_HAVE_BLOCKS
191 - (void)asyncReadIntoBuffer: (
void*)buffer
192 length: (
size_t)length
193 block: (of_stream_async_read_block_t)block;
213 - (void)asyncReadIntoBuffer: (
void*)buffer
214 exactLength: (
size_t)length
215 block: (of_stream_async_read_block_t)block;
236 - (uint16_t)readBigEndianInt16;
246 - (uint32_t)readBigEndianInt32;
256 - (uint64_t)readBigEndianInt64;
266 - (float)readBigEndianFloat;
276 - (double)readBigEndianDouble;
290 - (size_t)readBigEndianInt16sIntoBuffer: (uint16_t*)buffer
291 count: (
size_t)nInt16s;
305 - (size_t)readBigEndianInt32sIntoBuffer: (uint32_t*)buffer
306 count: (
size_t)nInt32s;
320 - (size_t)readBigEndianInt64sIntoBuffer: (uint64_t*)buffer
321 count: (
size_t)nInt64s;
335 - (size_t)readBigEndianFloatsIntoBuffer: (
float*)buffer
336 count: (
size_t)nFloats;
350 - (size_t)readBigEndianDoublesIntoBuffer: (
double*)buffer
351 count: (
size_t)nDoubles;
361 - (uint16_t)readLittleEndianInt16;
371 - (uint32_t)readLittleEndianInt32;
381 - (uint64_t)readLittleEndianInt64;
391 - (float)readLittleEndianFloat;
401 - (double)readLittleEndianDouble;
415 - (size_t)readLittleEndianInt16sIntoBuffer: (uint16_t*)buffer
416 count: (
size_t)nInt16s;
430 - (size_t)readLittleEndianInt32sIntoBuffer: (uint32_t*)buffer
431 count: (
size_t)nInt32s;
445 - (size_t)readLittleEndianInt64sIntoBuffer: (uint64_t*)buffer
446 count: (
size_t)nInt64s;
460 - (size_t)readLittleEndianFloatsIntoBuffer: (
float*)buffer
461 count: (
size_t)nFloats;
475 - (size_t)readLittleEndianDoublesIntoBuffer: (
double*)buffer
476 count: (
size_t)nDoubles;
488 - (
OFDataArray*)readDataArrayWithSize: (
size_t)size;
501 - (
OFDataArray*)readDataArrayWithItemSize: (
size_t)itemSize
502 count: (
size_t)nItems;
526 - (
OFString*)readStringWithLength: (
size_t)length;
543 - (
OFString*)readStringWithLength: (
size_t)length
544 encoding: (of_string_encoding_t)encoding;
562 - (
OFString*)readLineWithEncoding: (of_string_encoding_t)encoding;
577 - (void)asyncReadLineWithTarget: (
id)target
578 selector: (
SEL)selector;
594 - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding
596 selector: (
SEL)selector;
598 #ifdef OF_HAVE_BLOCKS
608 - (void)asyncReadLineWithBlock: (of_stream_async_read_line_block_t)block;
620 - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding
621 block: (of_stream_async_read_line_block_t)block;
642 - (
OFString*)tryReadLineWithEncoding: (of_string_encoding_t)encoding;
664 encoding: (of_string_encoding_t)encoding;
688 encoding: (of_string_encoding_t)encoding;
695 - (BOOL)writeBufferEnabled;
702 - (void)setWriteBufferEnabled: (BOOL)enable;
707 - (void)flushWriteBuffer;
715 - (void)writeBuffer: (const
void*)buffer
716 length: (
size_t)length;
723 - (void)writeInt8: (uint8_t)int8;
730 - (void)writeBigEndianInt16: (uint16_t)int16;
737 - (void)writeBigEndianInt32: (uint32_t)int32;
744 - (void)writeBigEndianInt64: (uint64_t)int64;
751 - (void)writeBigEndianFloat: (
float)float_;
758 - (void)writeBigEndianDouble: (
double)double_;
769 - (size_t)writeBigEndianInt16s: (const uint16_t*)buffer
770 count: (
size_t)nInt16s;
781 - (size_t)writeBigEndianInt32s: (const uint32_t*)buffer
782 count: (
size_t)nInt32s;
793 - (size_t)writeBigEndianInt64s: (const uint64_t*)buffer
794 count: (
size_t)nInt64s;
805 - (size_t)writeBigEndianFloats: (const
float*)buffer
806 count: (
size_t)nFloats;
817 - (size_t)writeBigEndianDoubles: (const
double*)buffer
818 count: (
size_t)nDoubles;
825 - (void)writeLittleEndianInt16: (uint16_t)int16;
832 - (void)writeLittleEndianInt32: (uint32_t)int32;
839 - (void)writeLittleEndianInt64: (uint64_t)int64;
846 - (void)writeLittleEndianFloat: (
float)float_;
853 - (void)writeLittleEndianDouble: (
double)double_;
864 - (size_t)writeLittleEndianInt16s: (const uint16_t*)buffer
865 count: (
size_t)nInt16s;
876 - (size_t)writeLittleEndianInt32s: (const uint32_t*)buffer
877 count: (
size_t)nInt32s;
888 - (size_t)writeLittleEndianInt64s: (const uint64_t*)buffer
889 count: (
size_t)nInt64s;
900 - (size_t)writeLittleEndianFloats: (const
float*)buffer
901 count: (
size_t)nFloats;
912 - (size_t)writeLittleEndianDoubles: (const
double*)buffer
913 count: (
size_t)nDoubles;
929 - (size_t)writeString: (
OFString*)string;
937 - (size_t)writeLine: (
OFString*)string;
961 arguments: (va_list)arguments;
968 - (size_t)pendingBytes;
985 - (void)setBlocking: (BOOL)enable;
992 - (int)fileDescriptorForReading;
999 - (int)fileDescriptorForWriting;
1017 - (size_t)lowlevelReadIntoBuffer: (
void*)buffer
1018 length: (
size_t)length;
1030 - (void)lowlevelWriteBuffer: (const
void*)buffer
1031 length: (
size_t)length;
1043 - (BOOL)lowlevelIsAtEndOfStream;
1045 - (BOOL)OF_isWaitingForDelimiter;