Questions tagged [inputstreamreader]
216 questions
0
votes
1 answer
Java InputStreamReader & UTF-8 charset
I use InputStreamReader to transfer compressed images. InflaterInputStream is used for decompression of images
InputStreamReader infis =
new InputStreamReader(
new InflaterInputStream( download.getInputStream()), "UTF8" );
do {
…

Dmitriy
- 161
- 2
- 12
-1
votes
1 answer
Reading a part of an inputStream and converting to list of bytes
I'm trying to impelment a method which recieves an InputStream from a txt file that has a certain string wrapped in quotation marks. The string should then be returned as a list of bytes.
public static List getQuoted(InputStream in) throws…

RONOLULU
- 727
- 1
- 4
- 12
-1
votes
3 answers
Reading a text that has multiple new lines
I have the following text:
My name is Omer
//new line
I want to start my own personal project and achieve a lot with it
//new line
//new line
I also have problems that I encounter along the way but I know I will overcome them
//new…

Esmer Omer
- 65
- 5
-1
votes
1 answer
when the file changed ,I read the file , the content of file is always the same?
I use watchevent provided by jdk1.8 to listen the file change event,but when the event come ,I read the file ,however, the content of file is always the same?
watch file change event code:
final WatchKey key = watcher.take();
for (WatchEvent>…

Ronaldo Huang
- 1
- 2
-1
votes
3 answers
Having trouble reading in content of url using InputStream
So I run the code below and it prints "!DOCTYPE html". How do I get the content of the url, like the html for instance?
public static void main(String[] args) throws IOException {
URL u = new URL("https://www.whitehouse.gov/");
…

Michael
- 39
- 9
-1
votes
2 answers
Why is InputStreamReader returning different content than browser?
If you enter this in a browser url:
https://charlotte.realforeclose.com/index.cfm?zaction=AUCTION&Zmethod=UPDATE&FNC=LOAD&AREA=W&PageDir=0&doR=1&AUCTIONDATE=07/16/2019
It returns a lot of data. But if I try to capture that data with an Input…

user3217883
- 1,216
- 4
- 38
- 65
-1
votes
1 answer
Issue with InputStreamConstructor
I tried to collect the data from a socket. For that, I coded :
InputStream i = socket.getInputStream();
InputStreamReader rawAnswer= InputStreamReader(i);
But an error occured ( I use Eclipse as an IDE ) : " The method…
-1
votes
1 answer
Reading Web Page 2nd Time Always Times out
I have the following method for reading a web page:
public String readURL() {
String response="";
try {
URL url=new URL(urlString);
BufferedReader br=new BufferedReader(new InputStreamReader(url.openStream()));
…

Wt Riker
- 514
- 12
- 24
-1
votes
1 answer
Bufferedreader and InputStreamReader
I am having trouble getting my java program to read any text files.
public static void main(String[] args) throws java.io.IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new…
-1
votes
2 answers
Error parsing a XML file with the InputStreamReader. Unexpected type: (positinon END_DOCUMENT null)
everyone, I'm new in Android and I'm trying to parse a XML file and get the info in a List. My XML file is this and what I want is get the objects.
What I am doing to parse it is something similar as the example on the android developeres…

Álvaro
- 1
- 3
-1
votes
1 answer
Expecting a string but was BEGIN_OBJECT: JsonReader
There are some other answers to this question on here but not sure how to get them to work with my code.
I have a lot of JSON to pass so I need to stream it rather than do it all at once. I cannot quite get the errors out of the code. Here is my…

BeniaminoBaggins
- 11,202
- 41
- 152
- 287
-1
votes
1 answer
I have an Issue with InputstreamReader and html
I am trying to scrap a table content from a URL using java but the scraper is apparently not working correctly. I Used the java docs on inputstreamReader and other online examples but was not able to figure out what my problem is. The problem is…

user3422517
- 93
- 2
- 9
-1
votes
1 answer
Need help understanding this code in Java
Now first of all, I would not be asking this is I knew nothing about input and output. I've watched tons of tutorials on PrintWriter, FileInputStream, InputStreamReader and IOException. I understand the concept of these classes. But I just don't…

User95
- 149
- 1
- 1
- 7
-1
votes
1 answer
InputstreamReader not reading all bytes of data from URL: android?
when I am trying to download files from server, it misses some bytes! and shows as a corrupted file. below the code i tried to download from URL. It gives no exception while running. I am using this in a service.
these are the sample results from…

Blue_Alien
- 2,148
- 2
- 25
- 29
-2
votes
1 answer
Receiving a utf-8 string using InputStreamReader from a Socket?
I'm trying to receive a string from a device using this code:
byte[] buf = new byte[4];
int read = inFromDevice.read(buf);
Logger.getLogger(Utill.class.getName() + " DEBUG_ERR01").log(Level.INFO, "Bytes read: {0}", read);
…

alibttb
- 526
- 4
- 19