binaryReader for javascript