From 5e875ba492944b80ad43cd4fbdedd2a6d2fd56d0 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 15 May 2020 19:23:56 +0200 Subject: [PATCH] Remove unused stream methods They were accidentally left unused in fbad8a9 so they haven't been used in some time. --- common/rdr/FdInStream.cxx | 29 +---------------------------- common/rdr/FdInStream.h | 1 - common/rdr/MemOutStream.h | 6 ------ 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/common/rdr/FdInStream.cxx b/common/rdr/FdInStream.cxx index 1730d6d1..ceb95c91 100644 --- a/common/rdr/FdInStream.cxx +++ b/common/rdr/FdInStream.cxx @@ -53,8 +53,7 @@ using namespace rdr; -enum { DEFAULT_BUF_SIZE = 8192, - MIN_BULK_SIZE = 1024 }; +enum { DEFAULT_BUF_SIZE = 8192 }; FdInStream::FdInStream(int fd_, int timeoutms_, size_t bufSize_, bool closeWhenDone_) @@ -97,32 +96,6 @@ size_t FdInStream::pos() return offset + ptr - start; } -void FdInStream::readBytes(void* data, size_t length) -{ - if (length < MIN_BULK_SIZE) { - InStream::readBytes(data, length); - return; - } - - U8* dataPtr = (U8*)data; - - size_t n = end - ptr; - if (n > length) n = length; - - memcpy(dataPtr, ptr, n); - dataPtr += n; - length -= n; - ptr += n; - - while (length > 0) { - n = readWithTimeoutOrCallback(dataPtr, length); - dataPtr += n; - length -= n; - offset += n; - } -} - - size_t FdInStream::overrun(size_t itemSize, size_t nItems, bool wait) { if (itemSize > bufSize) diff --git a/common/rdr/FdInStream.h b/common/rdr/FdInStream.h index d99ad3ce..007f35ce 100644 --- a/common/rdr/FdInStream.h +++ b/common/rdr/FdInStream.h @@ -47,7 +47,6 @@ namespace rdr { void setBlockCallback(FdInStreamBlockCallback* blockCallback); int getFd() { return fd; } size_t pos(); - void readBytes(void* data, size_t length); void startTiming(); void stopTiming(); diff --git a/common/rdr/MemOutStream.h b/common/rdr/MemOutStream.h index b56bac3a..a839473b 100644 --- a/common/rdr/MemOutStream.h +++ b/common/rdr/MemOutStream.h @@ -41,12 +41,6 @@ namespace rdr { delete [] start; } - void writeBytes(const void* data, size_t length) { - check(length); - memcpy(ptr, data, length); - ptr += length; - } - size_t length() { return ptr - start; } void clear() { ptr = start; }; void clearAndZero() { memset(start, 0, ptr-start); clear(); } -- 2.39.5