gzheader.js 1.2 KB

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