GithubHelp home page GithubHelp logo

Comments (7)

RReverser avatar RReverser commented on September 3, 2024

readAll() is just a helper for reading entire underlying structure (from 0 offset to the very end) as type aliased by jBinary.all. In es6 branch, I've added 'iterator' type but it's not merged yet because it slows down things as of now.

However, you can still read items one-by-one on your own if you need it - just do a loop with .read('YourType') in the body.

from jbinary.

danvk avatar danvk commented on September 3, 2024

Is there a way to convert a TypeSet to a Type? TypeSets can do a few things that mere Types cannot, e.g. reference one another and set endian-ness.

from jbinary.

RReverser avatar RReverser commented on September 3, 2024

TypeSet is just a set of types that applies to entire jBinary instance. You definitely can use custom endianness on case-by-case basis, as well as reference types from each other.

from jbinary.

danvk avatar danvk commented on September 3, 2024

I see, so if I do jBinary.read('mytype'), and 'mytype' is in the TypeSet that the jBinary object was constructed with, it'll work? i.e. jBinary.read('File')?

from jbinary.

RReverser avatar RReverser commented on September 3, 2024

Yep, exactly. As you can see from https://github.com/jDataView/jBinary/blob/master/src/proto/props.js#L61, .readAll() does pretty much the same under the hood.

from jbinary.

danvk avatar danvk commented on September 3, 2024

Got it!

Thanks for the great library, btw. It's made parsing bioinformatics formats a breeze.

from jbinary.

RReverser avatar RReverser commented on September 3, 2024

Glad it worked for you well! :)

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.