简体   繁体   中英

How to read more then 4096 symbols from terminal in clojure/java?

This code takes 2500 numbers from one line in clojure.

(import 'java.util.Scanner)
  (let [s (new Scanner *in*)]
    (for [i (range 2500)] (.nextInt s)))

But clojure takes only 4096 symbols.

I tried change scanner to buffer, but it doesn't work.

(import 'java.io.BufferReader)
(def r (new BufferedReader *in*))
(.read r)

It takes only 4096 symbols.

How to read more than 4096 symbols from on line from STDIN?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM