Closed andygup closed 10 years ago
Good catch, thanks! Do you have any more detail on how long strings this starts to happen? Or benchmarks for the two approaches. The reason I wanted to avoid str += String.fromCharCode(...) was my assumption that applying fromCharCode to an array would be a lot faster. If that's not the case, I'd be happy to go with this version. Well, if this version works for arbitrary-size strings, I'd go with this version as well.
According to this jsPerf the speed is not an issue. What's more, the loop is faster on Firefox.
When using Chrome, I encountered range limits when using readString on large binary objects.
In order to get around these errors I modified the readString method as follows. I haven't 100% tested this but I figured I would share in case anyone else encounters these issues: