Problem with own Scanner's methods
I need to realise simple version of scanner for much faster reading. I must use block reading available from Reader and its buffer. I can't get how to make hasNext methods (at least hasNext and hasNextInt) due to the problem, that if next appropriate answer is lay in some buffers and input is keyword I will lost intermediate buffers as i cant reread system input. also as i understand using linkedhashmap or String for intermediate buffers can cost a lot of memory if answer is lay in a few million buffers. can someone tell it is more sensible to realise these methods i have such realisation now(sorry if someone thinks that i have bad or cumbersome code, i m a newbie in java)
10 Replies
⌛ This post has been reserved for your question.
Hey @flechergame! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Depending on what you for your hasNext methods, you may not need a large buffer between methods
and if you need a bigger buffer locally (within one method), that can likely be optimized (at least if the method is used very frequently)
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.Hi, My name is Lukas and I'm proficient in Java.
I read your post and I think I can help you.
check this code
I hope this can help you
wow, it is almost ideally what i need, i will try to add checking special word patterns in it, thank you a lot, I can't contain my joy
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
You're welcome
is it working?
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.