GithubHelp home page GithubHelp logo

Comments (6)

RReverser avatar RReverser commented on September 3, 2024

Can you show what you are getting when logging data? And which typeset where you using - this one https://github.com/jDataView/jBinary.Repo/blob/gh-pages/typeSets/gzip.js?

from jbinary.

jetsnguns avatar jetsnguns commented on September 3, 2024

Yes, here it is:

Unzipping started
Object {_id1: 31, _id2: 139, compression: "Deflate", _reserved: 0, _hasComment: 0,_hasExtra: 0, hasHeaderCRC: 0, _hasName: 1, content: function(b), crc32: 1309749442, extraFlags: 0, input_size: 287, isText: 0, mod_time: Sat Feb 13 2016 03:16:11 GMT+0300 (Russia TZ 2 Standard Time), name: "dWA-compact-1.csvx", os: "FAT", __proto__: Object}
Unzipping finished

The file name of the archived file is correct, as well as byte size (287 byte unarchived).
I am using gzip.js with a slight modification to get rid of require.js. I use raw sources of inflate/deflate with it.

from jbinary.

RReverser avatar RReverser commented on September 3, 2024

So yeah, as you can see from structure in that file, it should be in content property, except that decompression happens lazily for performance reason (so you need to call .content() to actually decompress data).

from jbinary.

jetsnguns avatar jetsnguns commented on September 3, 2024

Yes, I tried that and it is not working - I receive an object instead of a string:

jBinary.load(zipfile, GZIP).then(function (jb) {

    var data = jb.readAll();

    var c = data.content();

    console.log(c);

    console.log('Unzipping finished');
});
Unzipping started
h {view: e, contexts: Array[0], typeSet: Object, cacheKey: "jBinary.Cache.3"}cacheKey: "jBinary.Cache.3"contexts: Array[0]typeSet: Objectview: e__proto__: h
Unzipping finished

from jbinary.

jetsnguns avatar jetsnguns commented on September 3, 2024

Thanks for help.
I have finally figured it out: need to call .content().read('string').

from jbinary.

RReverser avatar RReverser commented on September 3, 2024

@jetsnguns Yeah, sorry for not clarifying - it returns another jBinary into decompressed data to give you ability to work with it as regular file.

from jbinary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.