Is java.util.Scanner that slow?

后端 未结 7 1686
悲&欢浪女
悲&欢浪女 2021-02-07 08:17

In a Android application I want to use Scanner class to read a list of floats from a text file (it\'s a list of vertex coordinates for OpenGL). Exact code is:

Sc         


        
7条回答
  •  旧时难觅i
    2021-02-07 09:01

    Scanner may be part of the problem, but you need to profile your code to know. Alternatives may be faster. Here is a simple benchmark comparing Scanner and StreamTokenizer.

提交回复
热议问题