bufferedreader Questions
7
Solved
When receiving data using readLine(), even though I put a "\n" at the end of the message
using the .flush when sending the message, the while loop that reads my message still blocks.
Only when clos...
Hudak asked 20/3, 2013 at 10:46
4
Solved
I want to send a command to a server, and find out if I get a response.
Right now i am using BufferedReader's readline() function, which blocks until there's a response from server, but all I want...
Trimetallic asked 30/6, 2012 at 11:41
2
Solved
The InputStream is passed as a parameter from somewhere, where it will be further processed and then closed. So I don't want to close the InputStream here. Consider the following code:
void readIn...
Craniometry asked 6/4, 2019 at 12:52
3
Solved
I am studying Android development (I'm a beginner in programming in general) and learning about HTTP networking and saw this code in the lesson:
private String readFromStream(InputStream inputStre...
Friedman asked 31/3, 2017 at 18:7
2
Solved
When I define my array strings in this way:
String[] X = {"X","M","J","Y","A","U","Z"};
String[] Y = {"M","Z","J","A","W","X","U"};
my code works and it prints [M, J, A, U] which is the longest ...
Taeniacide asked 15/12, 2019 at 16:3
6
Solved
What is the difference between Java's BufferedReader and InputStreamReader classes?
Selfrighteous asked 11/9, 2011 at 6:15
2
Solved
I am trying to read the InputStream from IHTTPSession.getInputStream() using the following code but its gives Socket TimeOut Exception every time.
private String readInStream(InputStream in){
St...
Icono asked 24/7, 2014 at 10:40
7
Solved
Let's say, I have a folder called maps and inside maps I have map1.txt, map2.txt, and map3.txt. How can I use Java and the BufferReader to read all of the .txt files in folder maps (if it is at all...
Anguiano asked 7/5, 2011 at 21:55
3
Solved
I need some help:
I'm making a Supermarket simulation on Java, but I've got one problem, I have a text file (Stock.txt) where I have all the supermarket stock on it for example:
0-Bakery-Chocolat...
Monacid asked 1/6, 2015 at 1:25
5
Solved
I just learned about input/output using BufferedReader.
I wanted to know what exactly are the meanings of the term Stream and Buffer?
Also what does this line of code serves us:
BufferedReader b...
Fusion asked 13/4, 2013 at 6:1
3
Solved
Been looking for a way to fix this issue. Read all the previous answers but none helped me out.
Could it be any error with SonarQube?
public class Br {
public String loader(String FilePath){
B...
Contravallation asked 15/5, 2019 at 13:55
6
Solved
I have been searching a lot for the fastest way to read and write again a large files (0.5 - 1 GB) in java with limited memory (about 64MB). Each line in the file represents a record, so I need to ...
Legra asked 31/10, 2012 at 10:19
7
Solved
So I'm having an issue reading a text file into my program. Here is the code:
try {
InputStream fis = new FileInputStream(targetsFile);
BufferedReader br = new BufferedReader(new InputStreamReade...
Cherycherye asked 15/11, 2012 at 20:40
7
I am trying to practice reading text from a file in java. I am little stuck on how I can read N amount of lines, say the first 10 lines in a file and then add the lines in an ArrayList.
Say for ex...
Sweat asked 25/11, 2014 at 15:1
4
Solved
According to the documentation, BufferedReader(Reader) uses a default buffer size, while the second constructor, BufferedReader(Reader, int) allows the buffer size to be set.
public BufferedReader...
Buoyage asked 6/6, 2013 at 23:23
3
Here is a line reading a file into a List:
List<String> lines =
new BufferedReader(
new InputStreamReader(classLoader.getResourceAsStream(fileName)))
.lines()
.collect(Collectors.toList(...
Williemaewillies asked 26/2, 2019 at 15:26
1
Solved
I'm trying to efficiently read in, and parse, a compressed text file using the gzip module. This link suggests wrapping the gzip file object with io.BufferedReader, like so:
import gzip, io
gz = g...
Flyblown asked 10/2, 2019 at 18:59
2
So, I'm reading from a BufferedReader. Everything goes fine, until I add one condition. I need to read from BufferedReader for a specific duration of time.
This is what I'm doing right now.
whi...
Equilateral asked 2/2, 2019 at 16:29
6
Solved
I want to optimize this code:
InputStream is = rp.getEntity().getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String text = "";
String aux = "";
while ((au...
Informative asked 12/1, 2011 at 8:44
3
Solved
I am working on an app that takes the .txt file from a phone as input and prints it on the TextView,
public class MainActivity extends AppCompatActivity {
Button button;
Intent intent;private Stri...
Invalidism asked 9/10, 2018 at 4:9
6
Solved
I have to open a .exe file from my Java program. So I tried following code First.
Process process = runtime.exec("c:\\program files\\test\\test.exe");
But I was getting some error. Then I found...
Emera asked 21/5, 2012 at 13:10
2
Solved
I would like to read first (and only) line from File in kotlin.
File itself is huge so I would like to use memory efficient solution.
I wonder if there is any better solution than:
File("huge.txt...
Shum asked 14/9, 2018 at 14:2
6
I am trying to read a resource that will be included into a .JAR, but I get a nullPointer
for the following:
bReader = new BufferedReader(new InputStreamReader(
this.getClass().getResourceAsStrea...
Proven asked 3/3, 2013 at 17:18
6
I would like to know what are the mark() and reset() methods of BufferedReader? How do I use them? I read the Javadoc but as a beginner I was unable to understand it.
Accurate asked 23/11, 2011 at 9:47
4
Solved
I have a very large file (several GB) in AWS S3, and I only need a small number of lines in the file which satisfy a certain condition. I don't want to load the entire file in-memory and then searc...
Souther asked 24/7, 2018 at 19:3
© 2022 - 2025 — McMap. All rights reserved.