ObjFW
Public Member Functions
OFStream Class Reference

A base class for different types of streams. More...

#import <OFStream.h>

Inheritance diagram for OFStream:
OFObject <OFCopying> <OFObject> OFProcess OFSeekableStream OFStreamSocket OFFile OFTCPSocket

List of all members.

Public Member Functions

(BOOL) - isAtEndOfStream
 Returns a boolean whether the end of the stream has been reached.
(size_t) - readNBytes:intoBuffer:
 Reads at most size bytes from the stream into a buffer.
(void) - readExactlyNBytes:intoBuffer:
 Reads exactly the specified length bytes from the stream into a buffer.
(uint8_t) - readInt8
 Reads a uint8_t from the stream.
(uint16_t) - readBigEndianInt16
 Reads a uint16_t from the stream which is encoded in big endian.
(uint32_t) - readBigEndianInt32
 Reads a uint32_t from the stream which is encoded in big endian.
(uint64_t) - readBigEndianInt64
 Reads a uint64_t from the stream which is encoded in big endian.
(float) - readBigEndianFloat
 Reads a float from the stream which is encoded in big endian.
(double) - readBigEndianDouble
 Reads a double from the stream which is encoded in big endian.
(size_t) - readNBigEndianInt16s:intoBuffer:
 Reads the specified number of uint16_ts from the stream which are encoded in big endian.
(size_t) - readNBigEndianInt32s:intoBuffer:
 Reads the specified number of uint32_ts from the stream which are encoded in big endian.
(size_t) - readNBigEndianInt64s:intoBuffer:
 Reads the specified number of uint64_ts from the stream which are encoded in big endian.
(size_t) - readNBigEndianFloats:intoBuffer:
 Reads the specified number of floats from the stream which are encoded in big endian.
(size_t) - readNBigEndianDoubles:intoBuffer:
 Reads the specified number of doubles from the stream which are encoded in big endian.
(uint16_t) - readLittleEndianInt16
 Reads a uint16_t from the stream which is encoded in little endian.
(uint32_t) - readLittleEndianInt32
 Reads a uint32_t from the stream which is encoded in little endian.
(uint64_t) - readLittleEndianInt64
 Reads a uint64_t from the stream which is encoded in little endian.
(float) - readLittleEndianFloat
 Reads a float from the stream which is encoded in little endian.
(double) - readLittleEndianDouble
 Reads a double from the stream which is encoded in little endian.
(size_t) - readNLittleEndianInt16s:intoBuffer:
 Reads the specified number of uint16_ts from the stream which are encoded in little endian.
(size_t) - readNLittleEndianInt32s:intoBuffer:
 Reads the specified number of uint32_ts from the stream which are encoded in little endian.
(size_t) - readNLittleEndianInt64s:intoBuffer:
 Reads the specified number of uint64_ts from the stream which are encoded in little endian.
(size_t) - readNLittleEndianFloats:intoBuffer:
 Reads the specified number of floats from the stream which are encoded in little endian.
(size_t) - readNLittleEndianDoubles:intoBuffer:
 Reads the specified number of doubles from the stream which are encoded in little endian.
(OFDataArray *) - readDataArrayWithNItems:
 Reads the specified number of items with an item size of 1 from the stream and returns them in an OFDataArray.
(OFDataArray *) - readDataArrayWithItemSize:andNItems:
 Reads the specified number of items with the specified item size from the stream and returns them in an OFDataArray.
(OFDataArray *) - readDataArrayTillEndOfStream
 Returns an OFDataArray with all the remaining data of the stream.
(OFString *) - readStringWithLength:
 Reads a string with the specified length from the stream.
(OFString *) - readStringWithEncoding:length:
 Reads a string with the specified encoding and length from the stream.
(OFString *) - readLine
 Reads until a newline, \0 or end of stream occurs.
(OFString *) - readLineWithEncoding:
 Reads with the specified encoding until a newline, \0 or end of stream occurs.
(OFString *) - tryReadLine
 Tries to read a line from the stream (see readLine) and returns nil if no complete line has been received yet.
(OFString *) - tryReadLineWithEncoding:
 Tries to read a line from the stream with the specified encoding (see readLineWithEncoding:) and returns nil if no complete line has been received yet.
(OFString *) - readTillDelimiter:
 Reads until the specified string or \0 is found or the end of stream occurs.
(OFString *) - readTillDelimiter:withEncoding:
 Reads until the specified string or \0 is found or the end of stream occurs.
(OFString *) - tryReadTillDelimiter:
 Tries to reads until the specified string or \0 is found or the end of stream (see readTillDelimiter:) and returns nil if not enough data has been received yet.
(OFString *) - tryReadTillDelimiter:withEncoding:
 Tries to read until the specified string or \0 is found or the end of stream occurs (see readTIllDelimiterWithEncoding:) and returns nil if not enough data has been received yet.
(BOOL) - buffersWrites
 Returns a boolen whether writes are buffered.
(void) - setBuffersWrites:
 Enables or disables the write buffer.
(void) - flushWriteBuffer
 Writes everythig in the write buffer to the stream.
(void) - writeNBytes:fromBuffer:
 Writes from a buffer into the stream.
(void) - writeInt8:
 Writes a uint8_t into the stream.
(void) - writeBigEndianInt16:
 Writes a uint16_t into the stream, encoded in big endian.
(void) - writeBigEndianInt32:
 Writes a uint32_t into the stream, encoded in big endian.
(void) - writeBigEndianInt64:
 Writes a uint64_t into the stream, encoded in big endian.
(void) - writeBigEndianFloat:
 Writes a float into the stream, encoded in big endian.
(void) - writeBigEndianDouble:
 Writes a double into the stream, encoded in big endian.
(size_t) - writeNBigEndianInt16s:fromBuffer:
 Writes the specified number of uint16_ts into the stream, encoded in big endian.
(size_t) - writeNBigEndianInt32s:fromBuffer:
 Writes the specified number of uint32_ts into the stream, encoded in big endian.
(size_t) - writeNBigEndianInt64s:fromBuffer:
 Writes the specified number of uint64_ts into the stream, encoded in big endian.
(size_t) - writeNBigEndianFloats:fromBuffer:
 Writes the specified number of floats into the stream, encoded in big endian.
(size_t) - writeNBigEndianDoubles:fromBuffer:
 Writes the specified number of doubles into the stream, encoded in big endian.
(void) - writeLittleEndianInt16:
 Writes a uint16_t into the stream, encoded in little endian.
(void) - writeLittleEndianInt32:
 Writes a uint32_t into the stream, encoded in little endian.
(void) - writeLittleEndianInt64:
 Writes a uint64_t into the stream, encoded in little endian.
(void) - writeLittleEndianFloat:
 Writes a float into the stream, encoded in little endian.
(void) - writeLittleEndianDouble:
 Writes a double into the stream, encoded in little endian.
(size_t) - writeNLittleEndianInt16s:fromBuffer:
 Writes the specified number of uint16_ts into the stream, encoded in little endian.
(size_t) - writeNLittleEndianInt32s:fromBuffer:
 Writes the specified number of uint32_ts into the stream, encoded in little endian.
(size_t) - writeNLittleEndianInt64s:fromBuffer:
 Writes the specified number of uint64_ts into the stream, encoded in little endian.
(size_t) - writeNLittleEndianFloats:fromBuffer:
 Writes the specified number of floats into the stream, encoded in little endian.
(size_t) - writeNLittleEndianDoubles:fromBuffer:
 Writes the specified number of doubles into the stream, encoded in little endian.
(size_t) - writeDataArray:
 Writes from an OFDataArray into the stream.
(size_t) - writeString:
 Writes a string into the stream, without the trailing zero.
(size_t) - writeLine:
 Writes a string into the stream with a trailing newline.
(size_t) - writeFormat:
 Writes a formatted string into the stream.
(size_t) - writeFormat:withArguments:
 Writes a formatted string into the stream.
(size_t) - pendingBytes
 Returns the number of bytes still present in the internal cache.
(BOOL) - isBlocking
 Returns whether the stream is in blocking mode.
(void) - setBlocking:
 Enables or disables non-blocking I/O.
(int) - fileDescriptor
 Returns the file descriptor for the stream.
(void) - close
 Closes the stream.

Detailed Description

A base class for different types of streams.

Warning:
Even though the OFCopying protocol is implemented, it does not return an independant copy of the stream but instead retains it. This is so that the stream can be used as a key for a dictionary so context can be associated with a stream. Using a stream in more than one thread at the same time is not thread-safe, even if copy was called!
If you want to subclass this, override _readNBytes:intoBuffer:, _writeNBytes:fromBuffer: and _isAtEndOfStream, but nothing else. Those are not defined in the headers, but do the actual work. OFStream uses those and does all the caching and other stuff. If you override these methods without the _ prefix, you *WILL* break caching and get broken results!

Member Function Documentation

- (BOOL) buffersWrites

Returns a boolen whether writes are buffered.

Returns:
A boolean whether writes are buffered
- (int) fileDescriptor

Returns the file descriptor for the stream.

Returns:
The file descriptor for the stream
- (BOOL) isAtEndOfStream

Returns a boolean whether the end of the stream has been reached.

Returns:
A boolean whether the end of the stream has been reached
- (BOOL) isBlocking

Returns whether the stream is in blocking mode.

Returns:
Whether the stream is in blocking mode
- (size_t) pendingBytes

Returns the number of bytes still present in the internal cache.

Returns:
The number of bytes still present in the internal cache.
- (double) readBigEndianDouble

Reads a double from the stream which is encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A double from the stream in the native endianess
- (float) readBigEndianFloat

Reads a float from the stream which is encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A float from the stream in the native endianess
- (uint16_t) readBigEndianInt16

Reads a uint16_t from the stream which is encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A uint16_t from the stream in native endianess
- (uint32_t) readBigEndianInt32

Reads a uint32_t from the stream which is encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A uint32_t from the stream in the native endianess
- (uint64_t) readBigEndianInt64

Reads a uint64_t from the stream which is encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A uint64_t from the stream in the native endianess
- (OFDataArray *) readDataArrayTillEndOfStream

Returns an OFDataArray with all the remaining data of the stream.

Returns:
An OFDataArray with an item size of 1 with all the data of the stream until the end of the stream is reached.
- (OFDataArray *) readDataArrayWithItemSize: (size_t)  itemSize
andNItems: (size_t)  nItems 

Reads the specified number of items with the specified item size from the stream and returns them in an OFDataArray.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
itemSizeThe size of each item
nItemsThe number of items to read
Returns:
An OFDataArray with at nItems items.
- (OFDataArray *) readDataArrayWithNItems: (size_t)  nItems

Reads the specified number of items with an item size of 1 from the stream and returns them in an OFDataArray.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nItemsThe number of items to read
Returns:
An OFDataArray with at nItems items.
- (void) readExactlyNBytes: (size_t)  length
intoBuffer: (void*)  buffer 

Reads exactly the specified length bytes from the stream into a buffer.

Unlike readNBytes:intoBuffer:, this method does not return when less than the specified length has been read - instead, it waits until it got exactly the specified length.

Warning:
Only call this when you know that specified amount of data is available! Otherwise you will get an exception!
Parameters:
bufferThe buffer into which the data is read
lengthThe length of the data that should be read. The buffer MUST be EXACTLY this big!
- (uint8_t) readInt8

Reads a uint8_t from the stream.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A uint8_t from the stream
- (OFString *) readLine

Reads until a newline, \0 or end of stream occurs.

Returns:
The line that was read, autoreleased, or nil if the end of the stream has been reached.
- (OFString *) readLineWithEncoding: (of_string_encoding_t)  encoding

Reads with the specified encoding until a newline, \0 or end of stream occurs.

Parameters:
encodingThe encoding used by the stream
Returns:
The line that was read, autoreleased, or nil if the end of the stream has been reached.
- (double) readLittleEndianDouble

Reads a double from the stream which is encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A double from the stream in the native endianess
- (float) readLittleEndianFloat

Reads a float from the stream which is encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A float from the stream in the native endianess
- (uint16_t) readLittleEndianInt16

Reads a uint16_t from the stream which is encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A uint16_t from the stream in native endianess
- (uint32_t) readLittleEndianInt32

Reads a uint32_t from the stream which is encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A uint32_t from the stream in the native endianess
- (uint64_t) readLittleEndianInt64

Reads a uint64_t from the stream which is encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Returns:
A uint64_t from the stream in the native endianess
- (size_t) readNBigEndianDoubles: (size_t)  nDoubles
intoBuffer: (double*)  buffer 

Reads the specified number of doubles from the stream which are encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nDoublesThe number of doubles to read
bufferA buffer of sufficient size to store the specified number of doubles
Returns:
The number of bytes read
- (size_t) readNBigEndianFloats: (size_t)  nFloats
intoBuffer: (float*)  buffer 

Reads the specified number of floats from the stream which are encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nFloatssThe number of floats to read
bufferA buffer of sufficient size to store the specified number of floats
Returns:
The number of bytes read
- (size_t) readNBigEndianInt16s: (size_t)  nInt16s
intoBuffer: (uint16_t*)  buffer 

Reads the specified number of uint16_ts from the stream which are encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nInt16sThe number of uint16_ts to read
bufferA buffer of sufficient size to store the specified number of uint16_ts
Returns:
The number of bytes read
- (size_t) readNBigEndianInt32s: (size_t)  nInt32s
intoBuffer: (uint32_t*)  buffer 

Reads the specified number of uint32_ts from the stream which are encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nInt32sThe number of uint32_ts to read
bufferA buffer of sufficient size to store the specified number of uint32_ts
Returns:
The number of bytes read
- (size_t) readNBigEndianInt64s: (size_t)  nInt64s
intoBuffer: (uint64_t*)  buffer 

Reads the specified number of uint64_ts from the stream which are encoded in big endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nInt64sThe number of uint64_ts to read
bufferA buffer of sufficient size to store the specified number of uint64_ts
Returns:
The number of bytes read
- (size_t) readNBytes: (size_t)  size
intoBuffer: (void*)  buffer 

Reads at most size bytes from the stream into a buffer.

On network streams, this might read less than the specified number of bytes. If you want to read exactly the specified number of bytes, use -[readExactlyNBytes:intoBuffer:].

Parameters:
bufferThe buffer into which the data is read
lengthThe length of the data that should be read at most. The buffer MUST be at least this big!
Returns:
The number of bytes read
- (size_t) readNLittleEndianDoubles: (size_t)  nDoubles
intoBuffer: (double*)  buffer 

Reads the specified number of doubles from the stream which are encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nDoublesThe number of doubles to read
bufferA buffer of sufficient size to store the specified number of doubles
Returns:
The number of bytes read
- (size_t) readNLittleEndianFloats: (size_t)  nFloats
intoBuffer: (float*)  buffer 

Reads the specified number of floats from the stream which are encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nFloatsThe number of floats to read
bufferA buffer of sufficient size to store the specified number of floats
Returns:
The number of bytes read
- (size_t) readNLittleEndianInt16s: (size_t)  nInt16s
intoBuffer: (uint16_t*)  buffer 

Reads the specified number of uint16_ts from the stream which are encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nInt16sThe number of uint16_ts to read
bufferA buffer of sufficient size to store the specified number of uint16_ts
Returns:
The number of bytes read
- (size_t) readNLittleEndianInt32s: (size_t)  nInt32s
intoBuffer: (uint32_t*)  buffer 

Reads the specified number of uint32_ts from the stream which are encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nInt32sThe number of uint32_ts to read
bufferA buffer of sufficient size to store the specified number of uint32_ts
Returns:
The number of bytes read
- (size_t) readNLittleEndianInt64s: (size_t)  nInt64s
intoBuffer: (uint64_t*)  buffer 

Reads the specified number of uint64_ts from the stream which are encoded in little endian.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
nInt64sThe number of uint64_ts to read
bufferA buffer of sufficient size to store the specified number of uint64_ts
Returns:
The number of bytes read
- (OFString *) readStringWithEncoding: (of_string_encoding_t)  encoding
length: (size_t)  length 

Reads a string with the specified encoding and length from the stream.

If a \0 appears in the stream, the string will be truncated at the \0 and the rest of the bytes of the string will be lost. This way, reading from the stream will not break because of a \0 because the specified number of bytes is still being read and only the string gets truncated.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
encodingThe encoding of the string to read from the stream
lengthThe length (in bytes) of the string to read from the stream
Returns:
A string with the specified length
- (OFString *) readStringWithLength: (size_t)  length

Reads a string with the specified length from the stream.

If a \0 appears in the stream, the string will be truncated at the \0 and the rest of the bytes of the string will be lost. This way, reading from the stream will not break because of a \0 because the specified number of bytes is still being read and only the string gets truncated.

Warning:
Only call this when you know that enough data is available! Otherwise you will get an exception!
Parameters:
lengthThe length (in bytes) of the string to read from the stream
Returns:
A string with the specified length
- (OFString *) readTillDelimiter: (OFString*)  delimiter

Reads until the specified string or \0 is found or the end of stream occurs.

Parameters:
delimiterThe delimiter
Returns:
The line that was read, autoreleased, or nil if the end of the stream has been reached.
- (OFString *) readTillDelimiter: (OFString*)  delimiter
withEncoding: (of_string_encoding_t)  encoding 

Reads until the specified string or \0 is found or the end of stream occurs.

Parameters:
delimiterThe delimiter
encodingThe encoding used by the stream
Returns:
The line that was read, autoreleased, or nil if the end of the stream has been reached.
- (void) setBlocking: (BOOL)  enable

Enables or disables non-blocking I/O.

By default, a stream is in blocking mode. On Win32, this currently only works for sockets!

Parameters:
enableWhether the stream should be blocking
- (void) setBuffersWrites: (BOOL)  enable

Enables or disables the write buffer.

Parameters:
enableWhether the write buffer should be enabled or disabled
- (OFString *) tryReadLine

Tries to read a line from the stream (see readLine) and returns nil if no complete line has been received yet.

Returns:
The line that was read, autoreleased, or nil if the line is not complete yet
- (OFString *) tryReadLineWithEncoding: (of_string_encoding_t)  encoding

Tries to read a line from the stream with the specified encoding (see readLineWithEncoding:) and returns nil if no complete line has been received yet.

Parameters:
encodingThe encoding used by the stream
Returns:
The line that was read, autoreleased, or nil if the line is not complete yet
- (OFString *) tryReadTillDelimiter: (OFString*)  delimiter

Tries to reads until the specified string or \0 is found or the end of stream (see readTillDelimiter:) and returns nil if not enough data has been received yet.

Parameters:
delimiterThe delimiter
Returns:
The line that was read, autoreleased, or nil if the end of the stream has been reached.
- (OFString *) tryReadTillDelimiter: (OFString*)  delimiter
withEncoding: (of_string_encoding_t)  encoding 

Tries to read until the specified string or \0 is found or the end of stream occurs (see readTIllDelimiterWithEncoding:) and returns nil if not enough data has been received yet.

Parameters:
delimiterThe delimiter
encodingThe encoding used by the stream
Returns:
The line that was read, autoreleased, or nil if the end of the stream has been reached.
- (void) writeBigEndianDouble: (double)  double_

Writes a double into the stream, encoded in big endian.

Parameters:
double_A double
- (void) writeBigEndianFloat: (float)  float_

Writes a float into the stream, encoded in big endian.

Parameters:
float_A float
- (void) writeBigEndianInt16: (uint16_t)  int16

Writes a uint16_t into the stream, encoded in big endian.

Parameters:
int16A uint16_t
- (void) writeBigEndianInt32: (uint32_t)  int32

Writes a uint32_t into the stream, encoded in big endian.

Parameters:
int32A uint32_t
- (void) writeBigEndianInt64: (uint64_t)  int64

Writes a uint64_t into the stream, encoded in big endian.

Parameters:
int64A uint64_t
- (size_t) writeDataArray: (OFDataArray*)  dataArray

Writes from an OFDataArray into the stream.

Parameters:
dataArrayThe OFDataArray to write into the stream
Returns:
The number of bytes written
- (size_t) writeFormat: (OFConstantString*)  format
,   ... 

Writes a formatted string into the stream.

See printf for the format syntax. As an addition, %@ is available as format specifier for objects.

Parameters:
formatA string used as format
Returns:
The number of bytes written
- (size_t) writeFormat: (OFConstantString*)  format
withArguments: (va_list)  arguments 

Writes a formatted string into the stream.

See printf for the format syntax. As an addition, %@ is available as format specifier for objects.

Parameters:
formatA string used as format
argumentsThe arguments used in the format string
Returns:
The number of bytes written
- (void) writeInt8: (uint8_t)  int8

Writes a uint8_t into the stream.

Parameters:
int8A uint8_t
- (size_t) writeLine: (OFString*)  string

Writes a string into the stream with a trailing newline.

Parameters:
stringThe string from which the data is written to the stream
Returns:
The number of bytes written
- (void) writeLittleEndianDouble: (double)  double_

Writes a double into the stream, encoded in little endian.

Parameters:
double_A double
- (void) writeLittleEndianFloat: (float)  float_

Writes a float into the stream, encoded in little endian.

Parameters:
float_A float
- (void) writeLittleEndianInt16: (uint16_t)  int16

Writes a uint16_t into the stream, encoded in little endian.

Parameters:
int16A uint16_t
- (void) writeLittleEndianInt32: (uint32_t)  int32

Writes a uint32_t into the stream, encoded in little endian.

Parameters:
int32A uint32_t
- (void) writeLittleEndianInt64: (uint64_t)  int64

Writes a uint64_t into the stream, encoded in little endian.

Parameters:
int64A uint64_t
- (size_t) writeNBigEndianDoubles: (size_t)  nDoubles
fromBuffer: (const double*)  buffer 

Writes the specified number of doubles into the stream, encoded in big endian.

Parameters:
nDoublesThe number of doubles to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeNBigEndianFloats: (size_t)  nFloats
fromBuffer: (const float*)  buffer 

Writes the specified number of floats into the stream, encoded in big endian.

Parameters:
nFloatsThe number of floats to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeNBigEndianInt16s: (size_t)  nInt16s
fromBuffer: (const uint16_t*)  buffer 

Writes the specified number of uint16_ts into the stream, encoded in big endian.

Parameters:
nInt16The number of uint16_ts to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeNBigEndianInt32s: (size_t)  nInt32s
fromBuffer: (const uint32_t*)  buffer 

Writes the specified number of uint32_ts into the stream, encoded in big endian.

Parameters:
nInt32The number of uint32_ts to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeNBigEndianInt64s: (size_t)  nInt64s
fromBuffer: (const uint64_t*)  buffer 

Writes the specified number of uint64_ts into the stream, encoded in big endian.

Parameters:
nInt64The number of uint64_ts to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (void) writeNBytes: (size_t)  length
fromBuffer: (const void*)  buffer 

Writes from a buffer into the stream.

Parameters:
bufferThe buffer from which the data is written to the stream
lengthThe length of the data that should be written
- (size_t) writeNLittleEndianDoubles: (size_t)  nDoubles
fromBuffer: (const double*)  buffer 

Writes the specified number of doubles into the stream, encoded in little endian.

Parameters:
nDoublesThe number of doubles to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeNLittleEndianFloats: (size_t)  nFloats
fromBuffer: (const float*)  buffer 

Writes the specified number of floats into the stream, encoded in little endian.

Parameters:
nFloatsThe number of floats to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeNLittleEndianInt16s: (size_t)  nInt16s
fromBuffer: (const uint16_t*)  buffer 

Writes the specified number of uint16_ts into the stream, encoded in little endian.

Parameters:
nInt16The number of uint16_ts to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeNLittleEndianInt32s: (size_t)  nInt32s
fromBuffer: (const uint32_t*)  buffer 

Writes the specified number of uint32_ts into the stream, encoded in little endian.

Parameters:
nInt32The number of uint32_ts to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeNLittleEndianInt64s: (size_t)  nInt64s
fromBuffer: (const uint64_t*)  buffer 

Writes the specified number of uint64_ts into the stream, encoded in little endian.

Parameters:
nInt64The number of uint64_ts to write
bufferThe buffer from which the data is written to the stream after it has been byte swapped if necessary
Returns:
The number of bytes written to the stream
- (size_t) writeString: (OFString*)  string

Writes a string into the stream, without the trailing zero.

Parameters:
stringThe string from which the data is written to the stream
Returns:
The number of bytes written

The documentation for this class was generated from the following files:
 All Classes Functions Variables Properties