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