Questions tagged [outputstream]

An abstract mechanism for writing data to a stream in Java and C#

An OutputStream is an abstract mechanism for writing data to a stream in Java and C#. A stream is usually comprised of data to write to a local file, or data being transmitted to a remote server over a network protocol such as HTTP or FTP.

An OutputStream is abstract, and doesn't describe the type of data that is being written. Typically you would implement one of the subclasses instead, such as FileOutputStream, which more appropriately describes the type of data being handled, and provides additional methods appropriate for that data type.

1482 questions
-2
votes
1 answer

C++ How to output int as 32-bit binary?

I want to output an int in 32-bit binary format. Is looping and shifting my only option?
Varaquilex
  • 3,447
  • 7
  • 40
  • 60
-2
votes
1 answer

In JAVA How to send byte[] data to downloadable file?

I am working on a Dynamic Work Project in Eclipse using JAVA HttpServlets. I have some data in byte[] format which I am getting through some API call. I am able to store this in a new file but what I want is that it should be available for the user…
Abhinav
  • 961
  • 2
  • 11
  • 17
-2
votes
4 answers

What is System.out?

I have read that System.out is the default output stream of Java. But what is this out? System is a class in java.lang, but is out a subclass of System or a variable or something else?
JavaNewbie_M107
  • 2,007
  • 3
  • 21
  • 36
-2
votes
1 answer

Java: OutputStream to .exe Console App issue

I am trying to interact with a simple .exe I created from some Python code. I have tested the .exe through Windows cmd and it works just fine. When I try to send the same input to the .exe through my java program to produce the graphs I need,…
KonkAero
  • 3
  • 3
-2
votes
5 answers

Java sockets, everything written stays in memory

I am sending images through sockets using ByteArrayOutputStreams like this. ImageIO.write(image, "gif", byteArrayO); byte [] byteArray = byteArrayO.toByteArray(); Connection.pw.println("" + byteArray.length); int old =…
-3
votes
1 answer

FileInput/outputstream not working

i have a simple input/output stream here: package managingfilesanddirectories; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static…
kryptering
  • 17
  • 5
-3
votes
3 answers

Closing InputStream and OutputStream

I read in this post that a low level file handled is allocated whenever fileinputstream or outputstream is used and hence it is always necessary to close io stream. In case of other streams(eg: ByteArrayInputStream) which do not deal with file or…
Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
-3
votes
1 answer

Java IO: Resource file getting modified in IDE but not in jar

I am successfully able to read and write to a file in eclipse. I am also able to read from a file in the jar. However, I am not able to write to the file in the jar. It is located in a class folder called res. I have also unzipped the jar file and…
ARJAV GARG
  • 19
  • 9
-3
votes
1 answer

Object Serialization with ObjectStreams Vs ByteArrayStreams

I have written code to Serialize/De-serialize java Object with FileOutputStream/ObjectOutputStream & FileInputStream/ObjectInputStream Vs FileOutputStream/ByteArrayOutputStream & FileInputStream/ByteArrayInputStream import java.io.*; class…
Ravindra babu
  • 37,698
  • 11
  • 250
  • 211
-3
votes
3 answers

Java realtime writing file when it's opened

I want to write data to file when it's opened, but it doesn't work. Calendar getTime works nice, System.out.println() proves this. Please, any idea, what's wrong...? Main class: public static void main(String[] args) throws IOException { //…
oleh.meleshko
  • 4,675
  • 2
  • 27
  • 40
-4
votes
1 answer

Writing a list containing point objects to a text file

I'm trying to write a list that contains a list of points in to a text file. Below is my point class public class Point { private final double x; private final double y; public Point(double x, double y) { this.x = x; …
Lycon
  • 2,369
  • 2
  • 15
  • 16
-4
votes
3 answers

how can i change data of a file which is present in that package?(in java, how to get outputStream of that file?)

i've used ResorceLoder class to get input stream but how can i get outputStream, is this possible to modify data which is in that package?(i need to change the image files which are present in that package using java class which is present in the…
1 2 3
98
99