Remove unused bufSize argument from streams
This commit is contained in:
committed by
Lauri Kasanen
parent
281d65292a
commit
25995e2490
@@ -28,8 +28,8 @@ using namespace rdr;
|
|||||||
|
|
||||||
static const size_t DEFAULT_BUF_SIZE = 8192;
|
static const size_t DEFAULT_BUF_SIZE = 8192;
|
||||||
|
|
||||||
BufferedInStream::BufferedInStream(size_t bufSize_)
|
BufferedInStream::BufferedInStream()
|
||||||
: bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
|
: bufSize(DEFAULT_BUF_SIZE), offset(0)
|
||||||
{
|
{
|
||||||
ptr = end = start = new U8[bufSize];
|
ptr = end = start = new U8[bufSize];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace rdr {
|
|||||||
U8* start;
|
U8* start;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BufferedInStream(size_t bufSize=0);
|
BufferedInStream();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end of namespace rdr
|
} // end of namespace rdr
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ using namespace rdr;
|
|||||||
|
|
||||||
static const size_t DEFAULT_BUF_SIZE = 16384;
|
static const size_t DEFAULT_BUF_SIZE = 16384;
|
||||||
|
|
||||||
BufferedOutStream::BufferedOutStream(size_t bufSize_)
|
BufferedOutStream::BufferedOutStream()
|
||||||
: bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
|
: bufSize(DEFAULT_BUF_SIZE), offset(0)
|
||||||
{
|
{
|
||||||
ptr = start = sentUpTo = new U8[bufSize];
|
ptr = start = sentUpTo = new U8[bufSize];
|
||||||
end = start + bufSize;
|
end = start + bufSize;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace rdr {
|
|||||||
U8* sentUpTo;
|
U8* sentUpTo;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BufferedOutStream(size_t bufSize=0);
|
BufferedOutStream();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,19 +48,16 @@ using namespace rdr;
|
|||||||
|
|
||||||
enum { DEFAULT_BUF_SIZE = 8192 };
|
enum { DEFAULT_BUF_SIZE = 8192 };
|
||||||
|
|
||||||
FdInStream::FdInStream(int fd_, int timeoutms_, size_t bufSize_,
|
FdInStream::FdInStream(int fd_, int timeoutms_,
|
||||||
bool closeWhenDone_)
|
bool closeWhenDone_)
|
||||||
: BufferedInStream(bufSize_),
|
: fd(fd_), closeWhenDone(closeWhenDone_),
|
||||||
fd(fd_), closeWhenDone(closeWhenDone_),
|
|
||||||
timeoutms(timeoutms_), blockCallback(0),
|
timeoutms(timeoutms_), blockCallback(0),
|
||||||
timing(false), timeWaitedIn100us(5), timedKbits(0)
|
timing(false), timeWaitedIn100us(5), timedKbits(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
FdInStream::FdInStream(int fd_, FdInStreamBlockCallback* blockCallback_,
|
FdInStream::FdInStream(int fd_, FdInStreamBlockCallback* blockCallback_)
|
||||||
size_t bufSize_)
|
: fd(fd_), timeoutms(0), blockCallback(blockCallback_),
|
||||||
: BufferedInStream(bufSize_),
|
|
||||||
fd(fd_), timeoutms(0), blockCallback(blockCallback_),
|
|
||||||
timing(false), timeWaitedIn100us(5), timedKbits(0)
|
timing(false), timeWaitedIn100us(5), timedKbits(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,10 +37,8 @@ namespace rdr {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FdInStream(int fd, int timeoutms=-1, size_t bufSize=0,
|
FdInStream(int fd, int timeoutms=-1, bool closeWhenDone_=false);
|
||||||
bool closeWhenDone_=false);
|
FdInStream(int fd, FdInStreamBlockCallback* blockCallback);
|
||||||
FdInStream(int fd, FdInStreamBlockCallback* blockCallback,
|
|
||||||
size_t bufSize=0);
|
|
||||||
virtual ~FdInStream();
|
virtual ~FdInStream();
|
||||||
|
|
||||||
void setTimeout(int timeoutms);
|
void setTimeout(int timeoutms);
|
||||||
|
|||||||
@@ -49,9 +49,8 @@
|
|||||||
|
|
||||||
using namespace rdr;
|
using namespace rdr;
|
||||||
|
|
||||||
FdOutStream::FdOutStream(int fd_, bool blocking_, int timeoutms_, size_t bufSize_)
|
FdOutStream::FdOutStream(int fd_, bool blocking_, int timeoutms_)
|
||||||
: BufferedOutStream(bufSize_),
|
: fd(fd_), blocking(blocking_), timeoutms(timeoutms_)
|
||||||
fd(fd_), blocking(blocking_), timeoutms(timeoutms_)
|
|
||||||
{
|
{
|
||||||
gettimeofday(&lastWrite, NULL);
|
gettimeofday(&lastWrite, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace rdr {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FdOutStream(int fd, bool blocking=true, int timeoutms=-1, size_t bufSize=0);
|
FdOutStream(int fd, bool blocking=true, int timeoutms=-1);
|
||||||
virtual ~FdOutStream();
|
virtual ~FdOutStream();
|
||||||
|
|
||||||
void setTimeout(int timeoutms);
|
void setTimeout(int timeoutms);
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ using namespace rdr;
|
|||||||
|
|
||||||
static inline int min(int a, int b) {return a<b ? a : b;}
|
static inline int min(int a, int b) {return a<b ? a : b;}
|
||||||
|
|
||||||
HexInStream::HexInStream(InStream& is, size_t bufSize_)
|
HexInStream::HexInStream(InStream& is)
|
||||||
: BufferedInStream(bufSize_), in_stream(is)
|
: in_stream(is)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace rdr {
|
|||||||
class HexInStream : public BufferedInStream {
|
class HexInStream : public BufferedInStream {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
HexInStream(InStream& is, size_t bufSize=0);
|
HexInStream(InStream& is);
|
||||||
virtual ~HexInStream();
|
virtual ~HexInStream();
|
||||||
|
|
||||||
static bool readHexAndShift(char c, int* v);
|
static bool readHexAndShift(char c, int* v);
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ const int DEFAULT_BUF_LEN = 16384;
|
|||||||
|
|
||||||
static inline size_t min(size_t a, size_t b) {return a<b ? a : b;}
|
static inline size_t min(size_t a, size_t b) {return a<b ? a : b;}
|
||||||
|
|
||||||
HexOutStream::HexOutStream(OutStream& os, size_t buflen)
|
HexOutStream::HexOutStream(OutStream& os)
|
||||||
: out_stream(os), offset(0), bufSize(buflen ? buflen : DEFAULT_BUF_LEN)
|
: out_stream(os), offset(0), bufSize(DEFAULT_BUF_LEN)
|
||||||
{
|
{
|
||||||
if (bufSize % 2)
|
if (bufSize % 2)
|
||||||
bufSize--;
|
bufSize--;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace rdr {
|
|||||||
class HexOutStream : public OutStream {
|
class HexOutStream : public OutStream {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
HexOutStream(OutStream& os, size_t buflen=0);
|
HexOutStream(OutStream& os);
|
||||||
virtual ~HexOutStream();
|
virtual ~HexOutStream();
|
||||||
|
|
||||||
void flush();
|
void flush();
|
||||||
|
|||||||
@@ -24,9 +24,8 @@
|
|||||||
|
|
||||||
using namespace rdr;
|
using namespace rdr;
|
||||||
|
|
||||||
ZlibInStream::ZlibInStream(size_t bufSize_)
|
ZlibInStream::ZlibInStream()
|
||||||
: BufferedInStream(bufSize_),
|
: underlying(0), zs(NULL), bytesIn(0)
|
||||||
underlying(0), zs(NULL), bytesIn(0)
|
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace rdr {
|
|||||||
class ZlibInStream : public BufferedInStream {
|
class ZlibInStream : public BufferedInStream {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ZlibInStream(size_t bufSize=0);
|
ZlibInStream();
|
||||||
virtual ~ZlibInStream();
|
virtual ~ZlibInStream();
|
||||||
|
|
||||||
void setUnderlying(InStream* is, size_t bytesIn);
|
void setUnderlying(InStream* is, size_t bytesIn);
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ using namespace rdr;
|
|||||||
|
|
||||||
enum { DEFAULT_BUF_SIZE = 16384 };
|
enum { DEFAULT_BUF_SIZE = 16384 };
|
||||||
|
|
||||||
ZlibOutStream::ZlibOutStream(OutStream* os, size_t bufSize_, int compressLevel)
|
ZlibOutStream::ZlibOutStream(OutStream* os, int compressLevel)
|
||||||
: underlying(os), compressionLevel(compressLevel), newLevel(compressLevel),
|
: underlying(os), compressionLevel(compressLevel), newLevel(compressLevel),
|
||||||
bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
|
bufSize(DEFAULT_BUF_SIZE), offset(0)
|
||||||
{
|
{
|
||||||
zs = new z_stream;
|
zs = new z_stream;
|
||||||
zs->zalloc = Z_NULL;
|
zs->zalloc = Z_NULL;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace rdr {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ZlibOutStream(OutStream* os=0, size_t bufSize=0, int compressionLevel=-1);
|
ZlibOutStream(OutStream* os=0, int compressionLevel=-1);
|
||||||
virtual ~ZlibOutStream();
|
virtual ~ZlibOutStream();
|
||||||
|
|
||||||
void setUnderlying(OutStream* os);
|
void setUnderlying(OutStream* os);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ IntParameter zlibLevel("ZlibLevel","Zlib compression level",-1);
|
|||||||
|
|
||||||
ZRLEEncoder::ZRLEEncoder(SConnection* conn)
|
ZRLEEncoder::ZRLEEncoder(SConnection* conn)
|
||||||
: Encoder(conn, encodingZRLE, EncoderPlain, 127),
|
: Encoder(conn, encodingZRLE, EncoderPlain, 127),
|
||||||
zos(0,0,zlibLevel), mos(129*1024)
|
zos(0,zlibLevel), mos(129*1024)
|
||||||
{
|
{
|
||||||
zos.setUnderlying(&mos);
|
zos.setUnderlying(&mos);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user