Java read large text file with separator

后端 未结 6 839
悲哀的现实
悲哀的现实 2020-12-21 20:00

I\'m trying to read a large text file in the form of:

datadfqsjmqfqs+dataqfsdqjsdgjheqf+qsdfklmhvqziolkdsfnqsdfmqdsnfqsdf+qsjfqsdfmsqdjkgfqdsfqdfsqdfqdfssdqd         


        
6条回答
  •  攒了一身酷
    2020-12-21 20:26

    You should be able to get a String of length Integer.MAX_VALUE (always 2147483647 (231 - 1) by the Java specification, the maximum size of an array, which the String class uses for internal storage) or half your maximum heap size (since each character is two bytes), whichever is smaller

    How many characters can a Java String have?

提交回复
热议问题