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
3 answers

Writing to a new Blob in Java

I want to be able to create a new Blob object and then write to it. Originally, my general plan for this was as follows: Create a new blob (null, because there's no Blob constructor) Create a new OutputStream and set it to…
Benjadette
  • 23
  • 1
  • 1
  • 3
-2
votes
1 answer

Java 9 - URL InputStream and save to file with OutputStream freeze application flow

I'm trying to save response from URL on file with InputStream and OutputStream java . After the download of X bytes, the program freeze, no error no exception , nothing . I tryed with a lot s of solution (Outputstream buffer byte but all solutions…
Alberto
  • 123
  • 1
  • 2
  • 4
-2
votes
1 answer

Reading Bytes from an InputStreamReader goes into infinite loop

I've a test which fails because reading bytes from an InputStreamReader is going into infinite loop. @Test public void testSingleRequest() throws IOException { Server server = new Server(9000, 100); new Thread(server).start(); …
Melissa Stewart
  • 3,483
  • 11
  • 49
  • 88
-2
votes
3 answers

Java InputStream with different Object Classes

my code has to read in two different Object Types (Bestellung, AKunde) through a ObjectOutputStream and save it in a csv file, which works. But when i try to read them from the file it doesn't work. Here is the…
user9888269
-2
votes
1 answer

Why does my program close without printing a stack trace, or exception?

For some reason, when I load up my program it instantly closes - The load order is RunServer.java > Main.java. It is an encrypted messaging application, it only does this when I try to decrypt the message when they are received either by the Client…
-2
votes
1 answer

Java DataInputStream DataOutputStream

I'm trying to write in data already written by a person class into a .dat file using java.io.DataInputStream. Then, I want to output it using java.io.DataOutputStream through the console. I know I just create the variables then use a scanner class,…
D. Spigle
  • 541
  • 2
  • 5
  • 15
-2
votes
2 answers

Collecting the output messages in java

I'm trying to write a code that allows me to collect all the runtime messages printed into the output console. For example, while my app is running sometimes these exceptions pops up and I would like to collect them and print them as a string in my…
SSM
  • 379
  • 5
  • 16
-2
votes
1 answer

Two streams and one file

What will happen if I create two instances of class FileInputStream and FileOutputStream using the default constructor and as an argument specify the same path and file name like this.. FileInputStream is = new…
-2
votes
3 answers

Make sure Java will not close OutputStream before PrinWriter.print() finishes

I'm developing a distributed system that receives requests via Socket and writes the results back using OutputStream. I'm facing problems because I have to return a very large string, but Java just keeps the execution of the code after I call the…
maikel
  • 44
  • 1
  • 7
-2
votes
1 answer

Issue in getting size of File in android

This Code is not working for me. long length = file.length(); length = length/1024; Is there any another method to get size of file?
Nathani Software
  • 111
  • 1
  • 1
  • 7
-2
votes
2 answers

How to get the size of an empty "unwritten" stream?

I have an stream that is created with a fixed size. The buffer is empty. I want to be able to get the size of this buffer. What is an efficient way of doing this? Here is what I have done. static OutputStream CreateBuffer() { return…
nikk
  • 2,627
  • 5
  • 30
  • 51
-2
votes
4 answers

IOS: Convert a NSDate object into a string to get the current time

I'm Using NSOutputStream to output data from the client (IOS device) To the server (PC Device). In the following code I'm Outputting some data using outputStream and(this code is working 100% ) NSString *response = @" Today's Sunny \n "; …
Assam AlZookery
  • 479
  • 4
  • 15
-2
votes
1 answer

Multithreading socket output stream communication

I have my android tablet, (server) and I have my samsung S3 (client 1), and Samsung S4 (client 2) I have them both connect (or maybe not I created a new thread per connection that came in) to my tablet (server), I have them in a listview, and I…
andyADD
  • 610
  • 1
  • 6
  • 20
-2
votes
3 answers

Why server-side shows a null pointer exception (in client server application)?

In my client server application, client sends some commands and the server gives the results back. Now the problem is when the client tries to download a file from the server, by using GET filename command. The program works fine, even it can…
-2
votes
1 answer

How do I open / manipulate multiple files in bash?

I have a bash script that take advantage of a local toolbox to perform an operation my question is fairly simple I have multiple files that are the same quantities but different time steps i would like to first untar them all, and then use the…
George
  • 128
  • 3
  • 12
1 2 3
98
99