zstream.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict';
  2. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  3. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  4. //
  5. // This software is provided 'as-is', without any express or implied
  6. // warranty. In no event will the authors be held liable for any damages
  7. // arising from the use of this software.
  8. //
  9. // Permission is granted to anyone to use this software for any purpose,
  10. // including commercial applications, and to alter it and redistribute it
  11. // freely, subject to the following restrictions:
  12. //
  13. // 1. The origin of this software must not be misrepresented; you must not
  14. // claim that you wrote the original software. If you use this software
  15. // in a product, an acknowledgment in the product documentation would be
  16. // appreciated but is not required.
  17. // 2. Altered source versions must be plainly marked as such, and must not be
  18. // misrepresented as being the original software.
  19. // 3. This notice may not be removed or altered from any source distribution.
  20. function ZStream() {
  21. /* next input byte */
  22. this.input = null; // JS specific, because we have no pointers
  23. this.next_in = 0;
  24. /* number of bytes available at input */
  25. this.avail_in = 0;
  26. /* total number of input bytes read so far */
  27. this.total_in = 0;
  28. /* next output byte should be put there */
  29. this.output = null; // JS specific, because we have no pointers
  30. this.next_out = 0;
  31. /* remaining free space at output */
  32. this.avail_out = 0;
  33. /* total number of bytes output so far */
  34. this.total_out = 0;
  35. /* last error message, NULL if no error */
  36. this.msg = ''/*Z_NULL*/;
  37. /* not visible by applications */
  38. this.state = null;
  39. /* best guess about the data type: binary or text */
  40. this.data_type = 2/*Z_UNKNOWN*/;
  41. /* adler32 value of the uncompressed data */
  42. this.adler = 0;
  43. }
  44. module.exports = ZStream;