Comments (6)
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.
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.
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.
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.
Thanks for help.
I have finally figured it out: need to call .content().read('string').
from jbinary.
@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)
- Dispatch to typedef based on context? HOT 3
- ios write blob to file HOT 3
- Type Caching and Memory Use HOT 3
- Question: How to convert the "uint16" value to half-precision float (i.e. "float16")? HOT 1
- Dynamic Types? HOT 2
- jBinary::readAll does not mutate the internal pointer HOT 3
- writeAll() method documentation and functionality HOT 3
- corsproxy.com redirects to dubious web sites HOT 1
- SaveAsSync? HOT 2
- BROWSER vs NODE differences HOT 3
- Change Endianness (question) HOT 4
- "index out of range" with dynamic array size HOT 5
- Just don't work, maybe it caused by electron? :-{ HOT 1
- Local build is failing HOT 3
- Remove old polyfills
- Switch to ESM+Rollup
- How to read a string HOT 8
- reproducable out-of-memory errors using 'array'
- Strings ignores length on writing
- disregard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jbinary.