Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -125,21 +125,10 @@ */ - (size_t)readNItems: (size_t)nitems ofSize: (size_t)size intoBuffer: (uint8_t*)buf; -/** - * Reads from the file into a new buffer. - * - * \param size The size of the data that should be read - * \param nitem The number of items to read - * \return A new buffer with the data read. - * It is part of the memory pool of the OFFile. - */ -- (uint8_t*)readNItems: (size_t)nitems - ofSize: (size_t)size; - /** * Writes from a buffer into the file. * * \param buf The buffer from which the data is written to the file * \param size The size of the data that should be written Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -126,36 +126,10 @@ return [self readNItems: size ofSize: 1 intoBuffer: buf]; } -- (uint8_t*)readNItems: (size_t)nitems - ofSize: (size_t)size -{ - uint8_t *ret; - - ret = [self getMemForNItems: nitems - ofSize: size]; - - @try { - [self readNItems: nitems - ofSize: size - intoBuffer: ret]; - } @catch (id exception) { - [self freeMem: ret]; - @throw exception; - } - - return ret; -} - -- (uint8_t*)readNBytes: (size_t)size -{ - return [self readNItems: size - ofSize: 1]; -} - - (size_t)writeNItems: (size_t)nitems ofSize: (size_t)size fromBuffer: (const uint8_t*)buf { size_t ret; Index: src/OFStream.h ================================================================== --- src/OFStream.h +++ src/OFStream.h @@ -22,19 +22,10 @@ * \return The number of bytes read */ - (size_t)readNBytes: (size_t)size intoBuffer: (uint8_t*)buf; -/** - * Reads from the stream into a new buffer. - * - * \param size The size of the data that should be read - * \return A new buffer with the data read. - * It is part of the memory pool of the OFFile. - */ -- (uint8_t*)readNBytes: (size_t)size; - /** * Writes from a buffer into the stream. * * \param buf The buffer from which the data is written to the stream * \param size The size of the data that should be written Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -233,30 +233,10 @@ if ((ret = recv(sock, (char*)buf, size, 0)) < 1) @throw [OFReadFailedException newWithClass: [self class] andSize: size]; /* This is safe, as we already checked < 1 */ - return ret; -} - -- (uint8_t*)readNBytes: (size_t)size -{ - uint8_t *ret; - - if (sock == INVALID_SOCKET) - @throw [OFNotConnectedException newWithClass: [self class]]; - - ret = [self getMemWithSize: size]; - - @try { - [self readNBytes: size - intoBuffer: ret]; - } @catch (id exception) { - [self freeMem: ret]; - @throw exception; - } - return ret; } - (size_t)writeNBytes: (size_t)size fromBuffer: (const uint8_t*)buf