this will call to c++ regardless (i.e. jit can't do much about it), so might add the minor optimization to check if `binary`|`ascii` return chunk.length, if `ucs2` return `chunk.length * 2`