=========================================================================== * Send a stored block */
| 856 | * Send a stored block |
| 857 | */ |
| 858 | void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, |
| 859 | ulg stored_len, int last) { |
| 860 | send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */ |
| 861 | bi_windup(s); /* align on byte boundary */ |
| 862 | put_short(s, (ush)stored_len); |
| 863 | put_short(s, (ush)~stored_len); |
| 864 | if (stored_len) |
| 865 | zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); |
| 866 | s->pending += stored_len; |
| 867 | #ifdef ZLIB_DEBUG |
| 868 | s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; |
| 869 | s->compressed_len += (stored_len + 4) << 3; |
| 870 | s->bits_sent += 2*16; |
| 871 | s->bits_sent += stored_len << 3; |
| 872 | #endif |
| 873 | } |
| 874 | |
| 875 | /* =========================================================================== |
| 876 | * Flush the bits in the bit buffer to pending output (leaves at most 7 bits) |