i'm looking performance-oriented way read file buffer backwards (from end beginning).
the zip file format has crucial end of central directory record @ end of file (it n bytes back, there signature need find know have got it, can't read last 22 bytes of file since there optional 64k comment in there).
i couldn't find discussion on stack overflow or using google on how accomplish this.
check out module: https://github.com/bnoordhuis/node-buffertools
you use reverse function given module, creates new buffer in memory of equal length , loops through original buffer end, appending each element front of new buffer.
you better off using loop starting index buffer.length - 1 , decrementing until data want.
Comments
Post a Comment