| 110 | } |
| 111 | |
| 112 | void ICodec::Encode(const TData& in, TBuffer& out) const { |
| 113 | const size_t maxLen = MaxCompressedLength(in); |
| 114 | |
| 115 | out.Reserve(maxLen); |
| 116 | out.Resize(Compress(in, out.Data())); |
| 117 | } |
| 118 | |
| 119 | void ICodec::Decode(const TData& in, TBuffer& out) const { |
| 120 | const size_t len = GetDecompressedLength(in); |