32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/dcmdata/dcerror.h"
78 inline OFCondition decompress(
void *compressedData,
size_t compressedSize)
81 if (compressedSize == 0)
return EC_Normal;
86 if (compressedData == NULL)
fail_ = 1;
93 unsigned char *cp = OFstatic_cast(
unsigned char *, compressedData);
99 nbytes = OFstatic_cast(
unsigned char, 257 -
suspendInfo_);
111 nbytes = OFstatic_cast(
unsigned char, (
suspendInfo_ & 0x7f) + 1);
113 if (compressedSize < nbytes)
116 suspendInfo_ = OFstatic_cast(
unsigned char, nbytes - compressedSize - 1);
117 nbytes = OFstatic_cast(
unsigned char, compressedSize);
118 result = EC_StreamNotifyClient;
122 compressedSize -= nbytes;
127 while (compressedSize && (!
fail_))
138 nbytes = OFstatic_cast(
unsigned char, 257 - ch);
147 result = EC_StreamNotifyClient;
153 nbytes = OFstatic_cast(
unsigned char, (ch & 0x7f) + 1);
154 if (compressedSize < nbytes)
157 suspendInfo_ = OFstatic_cast(
unsigned char, nbytes - compressedSize - 1);
158 nbytes = OFstatic_cast(
unsigned char, compressedSize);
159 result = EC_StreamNotifyClient;
163 compressedSize -= nbytes;
169 if (
fail_) result = EC_CorruptedData;
195 if (
fail_)
return OFTrue;
else return OFFalse;
211 inline void replicate(
unsigned char ch,
unsigned char nbytes)
228 inline void literal(
unsigned char *cp,
unsigned char nbytes)