gzheader.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. function GZheader() {
  3. /* true if compressed data believed to be text */
  4. this.text = 0;
  5. /* modification time */
  6. this.time = 0;
  7. /* extra flags (not used when writing a gzip file) */
  8. this.xflags = 0;
  9. /* operating system */
  10. this.os = 0;
  11. /* pointer to extra field or Z_NULL if none */
  12. this.extra = null;
  13. /* extra field length (valid if extra != Z_NULL) */
  14. this.extra_len = 0; // Actually, we don't need it in JS,
  15. // but leave for few code modifications
  16. //
  17. // Setup limits is not necessary because in js we should not preallocate memory
  18. // for inflate use constant limit in 65536 bytes
  19. //
  20. /* space at extra (only when reading header) */
  21. // this.extra_max = 0;
  22. /* pointer to zero-terminated file name or Z_NULL */
  23. this.name = '';
  24. /* space at name (only when reading header) */
  25. // this.name_max = 0;
  26. /* pointer to zero-terminated comment or Z_NULL */
  27. this.comment = '';
  28. /* space at comment (only when reading header) */
  29. // this.comm_max = 0;
  30. /* true if there was or will be a header crc */
  31. this.hcrc = 0;
  32. /* true when done reading gzip header (not used when writing a gzip file) */
  33. this.done = false;
  34. }
  35. module.exports = GZheader;