java中使用readline()方法可以读取多少个字符?

发布于 2024-08-22 21:32:18 字数 133 浏览 3 评论 0原文

我使用 readLine() 方法来读取文本,但我不知道有多少文本可以读取该方法。前任。

String str = in.readLine();

“str”上可以读取和存储多少文本?

I using readLine() method for reading the text, but i am not aware of how many text can read that method. Ex.

String str = in.readLine();

how many texts can read and store on "str"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

怀念你的温柔 2024-08-29 21:32:18

Integer.MAX_VALUE,但显然你不应该经常遇到这个限制。

-- 请注意,这是因为 Integer.MAX_VALUE 是 Java String 的最大大小

Integer.MAX_VALUE, but you obviously should not be running into this limit very often.

-- and note that this is because Integer.MAX_VALUE is the maximum size for a Java String

思念满溢 2024-08-29 21:32:18

粗略地说,直到LINE BREAK。具体请参见马修的回答。干杯。

Till LINE BREAK, loosely speaking. For the exact, see Matthew's answer. Cheers.

ㄖ落Θ余辉 2024-08-29 21:32:18

它将读取尽可能多的可用数据,直到遇到 eol

it will read as many as are available until it encounters an eol

揽月 2024-08-29 21:32:18

这个错误让我相信没有限制。

This bug leads me to believe there is no limit.

明天过后 2024-08-29 21:32:18

如果你需要问这个问题,那么你的问题就更大了。为什么你正在阅读的行这么长以至于你需要担心它?这是上游设计不良的证据。

If you need to ask this question you have a much bigger problem. Why are the lines you are reading so long that you need to worry about it? This is evidence of poor design upstream.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文