All Questions
12 questions
0
votes
1
answer
202
views
Assert OutputStreamWriter contains correct instance of OutputStream
I'm writing a test for a method that returns Writer for different extension files.
For .gz returns new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(file)), StandardCharsets.UTF_8)
For ...
1
vote
1
answer
141
views
Is there a way to use a Java Writer object to write binary data?
I want to use the writeSearchResults method of this Jira plugin interface.
The description of the interface says that it should be possible to generate PDF files but I am not sure how to do this ...
1
vote
2
answers
3k
views
Blank pages in pdf after downloading it from web
I am trying to download a PDF file with HttpClient, it is downloading the PDF file but pages are blank. I can see the bytes on console from response if I print them. But when I try to write it to file ...
8
votes
1
answer
2k
views
Does an OutputStreamWriter without buffering exist?
I need to convert a stream of char into a stream of bytes, i.e. I need an adapter from a java.io.Writer interface to a java.io.OutputStream, supporting any valid Charset which I will have as a ...
2
votes
1
answer
3k
views
What's the difference between input/output streams and ordinary reader and writer and what's the difference between their types?
Now I don't seem to get the difference between those streams (Input/Output) and the ordinary writer and reader or even the scanner and formatter ...
and why does the InputStream have a lot of sub ...
133
votes
7
answers
25k
views
Is it necessary to close each nested OutputStream and Writer separately?
I am writing a piece of code:
OutputStream outputStream = new FileOutputStream(createdFile);
GZIPOutputStream gzipOutputStream = new GZIPOutputStream(outputStream);
BufferedWriter bw = new ...
0
votes
0
answers
26
views
Android: One writer don't wirte to file
Here is my function:
//This function is for parsing the online xml file and adding those to the ".txt" file
private void downloadData() throws Exception {
Thread thread = new Thread(){
...
5
votes
3
answers
4k
views
ObjectOutputStream writing extra characters
I know that writers should be used instead of outputstreams when writing text, but still I don't understand why there are extra characters in the file outputStream.txt after running this program:
...
0
votes
1
answer
689
views
Unable to send commands to Bukkit Server
I've got an issue sending commands to a Bukkit server for Minecraft.
My code work perfectly for Vanilla but when I try it with Bukkit it doesn't seem to want to work any longer. I still can receive ...
0
votes
1
answer
794
views
How do I write HAR data to a null Writer or OutputStream in Java?
I'm running a Browsermob Proxy while I surf via WebDriver to a video player app we're testing so I can read the headers and contents of our web service calls. Specifically I want to make sure the ...
40
votes
7
answers
55k
views
Log4J: How do I redirect an OutputStream or Writer to logger's writer(s)?
I have a method which runs asynchronously after start, using OutputStream or Writer as parameter.
It acts as a recording adapter for an OutputStream or Writer (it's a third party API I can't change).
...
1
vote
1
answer
8k
views
Trying to write a loop that uses an OutputStream to write to a text file
I'm not a java programmer, I'm a VB programmer. I am doing this as part of an assignment, however, I'm not asking for help on something assignment related. I'd like to figure out how to get the ...