FACT++  1.0
bool Huffman::Encode ( std::string &  bufout,
const uint16_t *  bufin,
size_t  bufinlen 
)
inline

Definition at line 385 of file huffman.h.

References Huffman::Encoder::count, Huffman::Encoder::Encode(), and Huffman::Encoder::WriteCodeTable().

Referenced by Compress(), CompressedFitsWriter::compressHUFFMAN(), and zofits::compressHUFFMAN16().

386  {
387  const Encoder encoder(bufin, bufinlen);
388 
389 #ifndef __EXCEPTIONS
390  if (encoder.count==0)
391  return false;
392 #endif
393 
394  bufout.append((char*)&bufinlen, sizeof(size_t));
395  encoder.WriteCodeTable(bufout);
396  encoder.Encode(bufout, bufin, bufinlen);
397 
398  return true;
399  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function: