Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Nathan Torchia
    @nemasu
    Greetings, how do I read a string of length x
    document says, string(@length, encoding = 'binary')
    But I'm not sure what that means
    the 2nd parameter wants to be the offset, and 3rd seems to be ignored
    *2nd parameter in read()
    Ingvar Stepanyan
    @RReverser
    that's for types
    which are constucted with JS array syntax
    so you should do like read(['string', length])
    @nemasu
    Dmitry Kabak
    @kabbi
    Hello! Sorry for awaking the old thread, but I've recently started using jBinary, and it's the best binary parsing/generating thing I've found on the net. So I'm using it a lot in making my game modding toolset.
    Have a noob question though: what is the best way to write file from data object? Is there a way to construct jBinary without preallocating the buffer large enough?
    Ingvar Stepanyan
    @RReverser
    @kabbi Glad you like it so far! As for the file, unfortunately, yes, you need to serialize data into a binary blob first and then write it to a file. If you have an array of smaller data chunks, you can represent them as a series of jBinary instances to decrease memory usage, but otherwise no good method to serialize directly at the moment (contributions are welcome though).
    Dmitry Kabak
    @kabbi
    @RReverser Okay, thank you. I may think of something, but I currently have no idea, except for some auto-expanding buffer mode.