Questions tagged [inputstreamreader]
216 questions
0
votes
1 answer
java InputStreamReader / BufferedReader "read" behavior
A related question is this one: Where is the specification that defines this behavior for InputStreamReader?, but I'm not sure if it answers mine...
Please note, I'm just experimenting with the language.
I have this code:
import…
user2612401
0
votes
1 answer
Java: Get duration of video file with avconv command
I'm trying to get the duration of a video file with Java, using the bash command
avconv -i test.avi 2>&1 | grep 'Duration' | awk '{print $2}' | sed s/,//
When I just enter the above command in terminal, there is exactly one output line displayed in…

Oliver
- 21
- 2
0
votes
2 answers
Java InputStreamReader invariable stalls
Here is my code:
public static void main(String[] args) {
String in = "";
InputStreamReader reader = new InputStreamReader(System.in);
int ch;
StringBuilder sb = new StringBuilder();
…

dylnmc
- 3,810
- 4
- 26
- 42
0
votes
2 answers
Trouble reading bytes from webpage response (amf)
I'm trying to write a program that can read different types of encoding from webpage responses. Right now I'm trying to figure out how to successfully read AMF data's response. Sending it is no problem, and with my HttpWrapper, it gets the response…

Eurater
- 1
- 2
0
votes
1 answer
UTF-8 encoding in InputStreamReader
I'm using openCSV to generate CSV file and OutputStreamWriter to attach that file to http response.
The biggest issue here is that for example '€' in downloaded CSV file is '€'. Obviously the encoding is wrong but I've set it to 'UTF-8'.…

Reeebuuk
- 1,363
- 2
- 21
- 42
0
votes
1 answer
get a new request.getInputStream() from @Context HttpServletRequest request in grails
I am having trouble seeing how i can read form the stream when its being read up in the chain somewhere.
here is my function
@POST
@Consumes(["application/json"])
public Response addGift(@Context HttpServletRequest…

TPEACHES
- 319
- 3
- 7
0
votes
1 answer
NullPointerException with InputStreamReader using getResourceAsStream
I am trying to read a text file from within the JAR archive of my program. I am getting a null pointer exception when I call the method. I can't find many examples of how to do this that work online, they are all much like what I am using.
public…

cyrus
- 51
- 1
- 5
0
votes
1 answer
HttpURLConnection response is incorrect
When using this code below to make a get request:
private String get(String inurl, Map headers, boolean followredirects) throws MalformedURLException, IOException {
URL url = new URL(inurl);
HttpURLConnection connection =…

boiiocks
- 3
- 3
0
votes
1 answer
Error in defining InputStreamReader for a BufferedReader in API 19
I am trying to create a simple source code reader that reads and displays the source-code of a web page using a URL entered in an EditText view, but can't initialise the InputSteramReader and the BufferedReader correctly. Testing this following code…

Sanchit18
- 163
- 1
- 1
- 8
0
votes
0 answers
How do I only send the output and not the input to InputStreamReader when executing a shell command using ProcessBuilder?
I am executing an executable with a command line argument using ProcessBuilder and I am trying to read the output using a BufferdReader. However, when I print out the input stream of the process, it seems I am first printing out the output, then the…

gruuuvy
- 2,028
- 4
- 31
- 52
0
votes
1 answer
How to view internet-passwords from Keychain using Java (mac)
I would like to create a simple java app (for mac) that takes in a website and outputs my password associated with the website in Keychain.
My problem is that my app can't read the password from the output. If I manually write:
security…

PaprikaSauce
- 3
- 3
0
votes
2 answers
Reading HttpURLConnection
I've been trying to figure out how to read a HttpURLConnection. According to this example: http://www.vogella.com/tutorials/AndroidNetworking/article.html , the following code should work. However, readStream never fires, and I'm not logging any…

ThomQ
- 595
- 2
- 11
- 32
0
votes
1 answer
Java: get InputStream out of an InputStreamReader
Is it possible to get an InputStream out of an InputStreamReader instance?
If yes, how?
EDIT: i'm reading a binary file over network, so i need to read bytes, not chars.
I haven't found a way to do this with an InputStreamReader....

user2422196
- 297
- 3
- 13
0
votes
3 answers
The constructor InputStreamReader(File) is undefined
import java.io.*;
public class Streams {
public static void main(String[] args) {
File homedir = new File(System.getProperty("user.home"));
File is = new File(homedir, "java/in.txt");
BufferedReader br = new…

Selva
- 546
- 5
- 12
- 34
0
votes
1 answer
InputStreamReader java.io.IOException: Stream is closed
I'm coding an app that connects to a server and retrieves data about turbines.
In the code I open two HTTP connections. the first one works, the seccond one throws this error.
Here's the code with the error:
private void downloadText(String urlStr)…

dodo
- 156
- 10