| 166 | } |
| 167 | |
| 168 | size_t GzipNoCompression (const uint8_t * in, uint16_t inLen, uint8_t * out, size_t outLen) |
| 169 | { |
| 170 | static const uint8_t gzipHeader[11] = { 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x01 }; |
| 171 | if (outLen < (size_t)inLen + 23) return 0; |
| 172 | memcpy (out, gzipHeader, 11); |
| 173 | htole16buf (out + 11, inLen); |
| 174 | htole16buf (out + 13, 0xffff - inLen); |
| 175 | memcpy (out + 15, in, inLen); |
| 176 | htole32buf (out + inLen + 15, crc32 (0, in, inLen)); |
| 177 | htole32buf (out + inLen + 19, inLen); |
| 178 | return inLen + 23; |
| 179 | } |
| 180 | |
| 181 | size_t GzipNoCompression (const std::vector<std::pair<const uint8_t *, size_t> >& bufs, uint8_t * out, size_t outLen) |
| 182 | { |
no test coverage detected