12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include "rar.hpp"
- BitInput::BitInput(bool AllocBuffer)
- {
- ExternalBuffer=false;
- if (AllocBuffer)
- {
-
-
-
-
- size_t BufSize=MAX_SIZE+3;
- InBuf=new byte[BufSize];
-
-
- memset(InBuf,0,BufSize);
- }
- else
- InBuf=NULL;
- }
- BitInput::~BitInput()
- {
- if (!ExternalBuffer)
- delete[] InBuf;
- }
- void BitInput::faddbits(uint Bits)
- {
-
- addbits(Bits);
- }
- uint BitInput::fgetbits()
- {
-
- return getbits();
- }
- void BitInput::SetExternalBuffer(byte *Buf)
- {
- if (InBuf!=NULL && !ExternalBuffer)
- delete[] InBuf;
- InBuf=Buf;
- ExternalBuffer=true;
- }
|