node-smartbuffer
An auto realloc buffer
Note
- buffer will auto realloc with buffer.append method when overflowed.
- realloc step by power of 2 for example smartbuffer ** [1,,].realloc() make 1,,,_ ** [1,,].realloc(5) make [1_,,,,,,]
usage
SmartBuffer = SmartBuffer;var buf = 5;buf; // make ['1','2','3',_,_] buf; // get buffer ['1','2','3'] buffer; // auto realloc and make ['1','2','3','4','5','6',_,_]