outputstream Questions

2

Existing ways of adding content to an S3 file using methods in AmazonS3 class are by putObject with an InputStream Creating a local file with content and uploading it to S3. Is there a way an O...

7

Solved

Is there anyway to check whether an OutputStream is closed without attempting to write to it and catching the IOException? For example, consider the following contrived method: public boolean isS...
Portraitist asked 28/12, 2011 at 12:24

6

Solved

I am writing a program in Java which displays a range of afterschool clubs (E.G. Football, Hockey - entered by user). The clubs are added into the following ArrayList: private ArrayList<Club&...
Nilgai asked 19/4, 2013 at 18:44

2

I have a large file download that is served by a RestController on one server, that I need to stream through a RestController on another server. When calling the end server directly the result stre...
Coprophilia asked 21/6, 2016 at 8:59

5

Solved

I am using HTTPURLConnection to connect to a web service. I know how to use HTTPURLConnection but I want to understand how it works. Basically, I want to know the following: On which point does H...
Interchange asked 12/4, 2012 at 3:22

3

Solved

Network environment: Https Client<=============>Proxy Server<==============>Https Server                 &...
Caras asked 10/4, 2013 at 13:21

9

Solved

I need to specify an OutputStream for an API I'm using, but I don't actually have a need for the output. Does Java have an OutputStream equivalent to > /dev/null?
Penicillate asked 27/3, 2009 at 23:33

1

Solved

What is the most reliable pattern to follow when closing an OutputStream, ServerSocket, or other object that implements the AutoCloseable interface? Should I use try-catch-finally? Or a shutdown h...
Rimarimas asked 13/5, 2019 at 12:41

2

Solved

How would a process read its own output stream? I am writing automated tests which start a few application sub-processes (applications) in the same process as the test. Therefore, the standard out ...
Smectic asked 15/3, 2019 at 5:59

5

Solved

I have a socket to which I write some character data, and some raw byte data. For the character data, it's easier to use a PrintWriter. For the raw byte data, it's easier to write directly to the O...
Overwrite asked 4/3, 2013 at 1:30

3

Solved

With Java 11, I could initialize an InputStream as: InputStream inputStream = InputStream.nullInputStream(); But I am unable to understand a potential use case of InputStream.nullInputStream or...
Whoremaster asked 23/11, 2018 at 14:52

1

Solved

I am running a Java program written by another person on more data than the program was initially designed for, e.g. 10-times longer input files, roughly quadratic runtime. I encountered different ...
Feticide asked 22/10, 2018 at 14:3

6

Solved

Since ByteArrayOutputStream simply writes to memory, an IOException should never occur. However, because of the contract of the OutputStream interface, all stream operations define IOException in t...

3

Solved

I’ve been reading on InputStream, FileInputStream, ByteArrayInputStream and how their use seems quite clear (output streams too). What I’m struggling is to understand the use of FilterInputStream ...
Walczak asked 5/7, 2013 at 18:5

4

Solved

Do I need to "flush" the OutputStream from the HttpServletResponse? I already saw from to Should I close the servlet outputstream? that I don't need to close it, but it's not clear if I need to fl...
Coronal asked 18/2, 2011 at 16:10

2

Solved

I've seen the code for javax.mail library where you add attachments to the email doing this: MimeBodyPart attachmentPart = new MimeBodyPart(); FileDataSource fds = new FileDataSource("C:/text.txt"...
Zackaryzacks asked 29/3, 2013 at 19:5

4

I want to return a zipped file from my server-side java using JAX-RS to the client. I tried the following code, @GET public Response get() throws Exception { final String filePath = "C:/MyFolde...
Rebane asked 5/4, 2014 at 13:24

1

Solved

I try to code a simple async write with timeout as below and expect the function to throw a TaskCanceledException given a very large buffer and small waitTime. However, this does not happen. WriteA...
Meza asked 13/12, 2017 at 1:23

0

I am using OAuth2RestTemplate class of spring-security-oauth2-2.1.1.RELEASE for rest client services. Ideally, whenever an access token expires, the template should retry the failed request by fetc...
Condiment asked 6/12, 2017 at 12:54

3

Solved

I'm trying to execute post request using HttpURLConnection but don't know how to do it correctly. I can successfully execute request with AndroidAsyncHttp client using following code: AsyncHttpCl...
Propertied asked 29/11, 2013 at 5:49

10

update in java9: https://docs.oracle.com/javase/9/docs/api/java/io/InputStream.html#transferTo-java.io.OutputStream- I saw some similar, but not-quite-what-i-need threads. I have a server, which ...
Adao asked 15/10, 2009 at 20:29

2

Solved

When I write the output stream in multipeer connectivity from audio buffer data I got the error Cannot invoke initializer for type UnsafePointer<_> with an argument list of type (UnsafeMuta...

4

Solved

In the following code the close function for outPutStream throw an IOException exception that I should catch. My question is do I need to handle it? Since I'm working with mobile devices and I want...
Kosygin asked 14/12, 2011 at 15:47

2

Solved

How can I get the bytes of an outputStream, or how can I convert an outputStream to a byte array?
Circum asked 28/3, 2017 at 22:21

2

Solved

I know this question has been asked before, but I can't make it to work. Please help. I added the external storage permission, why is it still read-only? public class MainActivity extends Activity...
Pavyer asked 23/5, 2015 at 10:39

© 2022 - 2024 — McMap. All rights reserved.