Questions tagged [inputstreamreader]

216 questions
0
votes
1 answer

Cannot return result from System.in InputStreamReader

I'm having trouble just return the string of the color. For some reason it will not return the num. Not sure if I need to insert the end of the if statement with an else but I feel like that what the catch statement if for. Main Class package…
Chance Smith
  • 33
  • 1
  • 8
0
votes
0 answers

Read key from java console exception

I want to read a key from console but I get this exception and I am pretty stacked on it. I would appreciated any help! public char readKey() { char key = ' '; try { BufferedReader br = new BufferedReader(new…
stebetko
  • 735
  • 1
  • 8
  • 24
0
votes
1 answer

InputStreamReader throws NPE on second iteration of for loop

InputStreamReader throws an NPE as follows when I execute this code on the second iteration of the for loop. The code works perfectly for the first iteration and returns the following NPE on the second iteration. I am using the code snippet to read…
krishnang
  • 698
  • 1
  • 7
  • 21
0
votes
2 answers

Character Encoding downloading text from a web page

I am trying to get some text from an HTML page, I can download correctly but the accents in spanish (á, é, í, ó, ú) and probably other special caracters ( ü ) are being showed like a square with a ? mark inside. Once the InputStreamReader I use…
garfield185
  • 213
  • 2
  • 11
0
votes
1 answer

How do I dump my decrypted text file byte blocks into an InputStreamReader?

In the CBC decryption loop I'm dealing with small (< 32 bytes) byte chunks so I can't use a StringBuilder because the Heap blows up. I figure I should take the decrypted bytes and dump them into some kind of buffered array. At this point I'm…
fooledbyprimes
  • 999
  • 1
  • 11
  • 29
0
votes
1 answer

Getting only a part of text with InputStreamReader

I am reading from InputStreamReader but I only get the first 10,000 characters of the text that is supposed to come. Any idea what the problem may be? If there is no solution with this class, what are my alternatives? I found this about…
Egis
  • 879
  • 2
  • 9
  • 13
0
votes
1 answer

Problems using Android Scanner+BufferedReader

I've been working on adapting code from an existing java project into the android environment. I load a map from a text file of integers which correspond to a sprite sheet. e.g. 0=grass 1=wall 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0…
0
votes
1 answer

How to read integer from InputStremReader

I'm a beginner... please bear with me :) This is a code that supposedly reads 10 integers in an array. The InputStreamReader reads in char (that what java Docs said) how to convert the char into int to be saved in the array? int[] array = new…
0
votes
3 answers

Download file line by line java

I know this question might sound really basic for most of you. I need to download a large file from server. The first line of this file contains a time tag. I want to download entire file only if my time tag mismatches to that of file. For this I'm…
Gaurav Arora
  • 17,124
  • 5
  • 33
  • 44
0
votes
2 answers

Confusion about DataOutputStream

I wrote the code below to familiarise myself with DataOutputStream. I suppose there would be some kind of 11010111 binary in the file where I output the data, instead, there are just some readable strings. My question is: shouldn't there be binary…
glenlivet1986
  • 260
  • 3
  • 12
0
votes
1 answer

Stream Reader/Writer for RTSP WinRT Client App

I have spend hours to convert an old net v2 project and to port it to WinRT in C#. Its a RTSP client thats sending commands to a DVBservice (DVBViewer). So, at this moment, the WinForm Program has been renewed and its working prety fine. Connecting,…
0
votes
1 answer

Android app crashing on 404, unable to handle exceptions on InputStreamReader

So in my android app, which uses GET to pull a webpage and download the text, I perform: private InputStream OpenHttpConnection(String urlString) throws IOException { Log.d("Networking", "InputStream called"); InputStream in = null; int…
James
  • 363
  • 1
  • 4
  • 14
0
votes
2 answers

Troubleshooting BufferedReader Java

I am currently trying to access a multitude of very similar websites that contain only text, and are all formatted in the same way. The first 5-30 times I call this method, it works, but after that it returns null. No error. Is there any reason that…
Echocage
  • 270
  • 2
  • 4
  • 14
0
votes
5 answers

java create InputStreamReader object from InputStream

I have a web service receiving a upload text file. So on the server side, I got an InputStream object, and I try to wrap it as an InputStreamReader with "UTF8" as the charset. But I notice when I upload a file encoded in US-ASCII can also work. It…
Ensom Hodder
  • 1,522
  • 5
  • 18
  • 35
0
votes
2 answers

Why am i getting ?? when i try to read ä character from a text file in java?

I am trying to read text from a text file. There are some special characters like å,ä and ö. When i make a string and print out that string then i get ?? from these special characters. I am using the following code: File fileDir = new…
Piscean
  • 3,069
  • 12
  • 47
  • 96