Questions tagged [outputstream]

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

5
votes
1answer
45 views

Java StackOverflowError at java.io.PrintStream.write(PrintStream.java:480) and no further stack trace

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 ...
0
votes
0answers
15 views

Should I reopen the socket I/O streams every time I want to send data from chat server

I recently started learning android and am currently learning java fundamentals from edx.org. I'm creating a chat application (client/server). right now all I want to do is to display a "user ...
0
votes
0answers
16 views

can't read system output of subprocess that I ran with runtime.exec

I'm trying to create a sub-process, send it two integers and then receive the sum of these integers from it as follows: this is the main process class: import java.io.DataInputStream; import java.io....
2
votes
2answers
25 views

How to create missing folders from path with PrintWriter?

I'm writing a string file from disk using PrintWriter with this code: public static void storeString(String string, String path) { PrintWriter out = null; try { out = new PrintWriter(...
0
votes
0answers
15 views

Resetting std::setprecision and std::fixed [duplicate]

Suppose I have the following program, where I print the decimals 0.1234 and 0.5, and then I format the output so that it only gives 2 decimal places. Then, I print out some decimal numbers. #include &...
0
votes
1answer
40 views

How to write a binary file from a String and retrieve it again to a String?

I have a string and want to persist it into a file and be able to retrieve it again into a String. Something is wrong with my code because It's supposing that I must write something binary non ...
0
votes
0answers
9 views

outputStream error using google disk api exit out null files

outputStream error using google disk api exit out null files ,but why i`dont now why i how ! String fileId = file.getId(); OutputStream outputStream = new ByteArrayOutputStream();...
0
votes
0answers
27 views

Java outputs ugly/weird letters to text file [duplicate]

So i'm trying to make this web scraping thing to scrape all my grades off my colleges website and upload it to text file. my native language has weird letters like "ā,ķ,ļ" and so on. i got everything ...
0
votes
2answers
24 views

In Android what happens to a File when the app crashes elsewhere during a write?

Lets say I have a background task that writes a random letter to a file through an FileOutputStream every 5s. After 1 min the stream will close and the task will stop. Let's say the app then crashes ...
0
votes
0answers
41 views

after upgrade iOS12 hasSpaceAvailable return 'false'

after upgrade to iOS 12 , 'hasSpaceAvailable' return 'false' frequently. not every time, quite often occure compare with iOS11 other devices that is iOS11 do not return false. Are there any change ...
0
votes
1answer
66 views

Logging HttpListener Response OutputStream during debug

I try to get every request and response of my HttpListener logged. For the HttpListenerContext.Request.InputStream, this was as simple as doing this: var finfoIn = context.Request.GetType().GetField(...
0
votes
0answers
18 views

outputStream write method in Android

I'm building an app for a company that communicates with MySQL database, I'm trying to send a new entry to the server, but I can't get the outputstream write method to work, I know there's an error ...
0
votes
0answers
19 views

Is there a way to create files directly inside a java zip file in java language [duplicate]

I have a question. I'm trying to record a file directly inside the zip folder(that already exists). I don't wanted to created a folder to after compressed this folder with the files inside. Is there a ...
-1
votes
2answers
72 views

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.InputStream.read(byte[])' on a null object reference

I am trying to create Chat Application using WiFip2p.Everything is done in this application. Before send and receive message app was working good. After that i got this error. I am getting this error ...
0
votes
1answer
37 views

Swift 4, reading byte data

so I recently update my IMAC and Xcode, after updating part of my code wasn't running as its supposed to it. Here is where I originally check messages. func checkForMessages() { while true { ...
0
votes
1answer
37 views

Java pattern for subsequent Input & OutputStream

Hello stack overflow world, I've been struggling with the most straight forward and common problem within Java IO, for some time, and now need your help to tackle it. Check out this piece of code I ...
1
vote
0answers
17 views

Stream csv file download immediately without waiting

I have REST API, which calls a method to retrieve CSV, as csv can be millions of rows, I am retrieving 50k rows at a time, I want the download to begin as soon as I receive first query result and ...
1
vote
1answer
48 views

Is it possible to create more than 1 consumers on InputStream and OutputStream?

I am implementing a Java project using client-server architecture. My client goes into an infinite loop when connected via socket. EDIT1: I have changed my client and server programs to minimal, ...
0
votes
0answers
22 views

How to use PipedInputStream and PipedOutputStream

There are many examples of using while converting OutputStream to InputStream. How could I complete the missing parts below? I mean putDataOnOutputStream(out) method. If it is still needed to use ...
1
vote
0answers
55 views

Incomplete UTF8 char for UTF8 imbued std stream

I recently got a weird bugreport. The problem is that the following produces an incomplete UTF8 char on some machines: #include <iostream> #include <sstream> int main() { std::...
0
votes
1answer
38 views

How sent input information to Localdatabase from androidstodio

I'm starter with Android and I'm trying an example to get some information from an edittext and send that to my localhost and if my Localdatabase isset that so echo something, but whatever I did, it ...
1
vote
0answers
7 views

During csv export the double quotes are wrong written by OutPutStream

I m exporting a CSV with the below implementation. The output is fine for all the Csv Names except "application" tag. The double quotes are changed and the data becomes corrupt as it cannot be ...
1
vote
1answer
51 views

FFMPEG Multiple outputs from BlackMagic input

I'm currently needing help to achieve multiple outputs from one input. Right now, the outputs are set like this: ffmpeg -re -f decklink -i "DeckLink Mini Recorder" -y -pix_fmt yuv420p -c:v h264 -...
0
votes
0answers
29 views

Items from a folder compressing to items.dat and .idx

Hello im trying to make a compressor for items, but i dont seem to quite get it, i have a original file that im testing like (items.dat, idx) my decompressor decompresses it all good but when i use my ...
0
votes
0answers
20 views

Excel generated by Java server is downloaded as corrupt from js/java client and cannot be opened

I am creating a web application that allows users to download a report (excel file) after some processing is done. Currently, I have my server side application -java- create the excel report and send ...
0
votes
0answers
43 views

How can I force Java's jSerialComm to idle for a short time between messages sent over a serial connection?

I'm using Java's jSerialComm package to communicate with a series of devices over a shared RS485 serial connection on several different OS setups (Windows and Linux, some with USB-to-serial adapters ...
0
votes
0answers
35 views

How to write Blob data into html in java

I have a html tag <td> <table style="padding-left:20px"> <tr> <td align="middle"><img align="middle" src="{{LINK_FILE}}" style="margin-left: -7px; width:...
0
votes
0answers
28 views

How to send object over java socket (java networking) and read it

I want to make chat application using java networking. So far I have made server and client class in two different projects and each of them have the same Message class: package client; import java....
0
votes
1answer
32 views

PHP prints out a buffer string into web-page on certain circuntances?

I don't know how to explain it but, I'm gonna give it a try. This problem concerns 2 servers, a local and a hosting server. Both servers are running the same PHP version which is 7.0 [with almost ...
0
votes
1answer
39 views

How to rewrite DocumentFile

I want to let user to pick up folder and my app will make a file in this folder. So I use Intent.ACTION_OPEN_DOCUMENT_TREE. Google says that I need to use DocumentFile instead of File. Previously I ...
0
votes
1answer
27 views

ScreenCap directly toByteArray , skipping saving to memory

I'm trying to optimise the code below , would it be possible to directly ScreenCap to Byte Array so I can skip the step of saving it into memory. Process sh = Runtime.getRuntime().exec("su", null,...
0
votes
0answers
37 views

How do I write a GridFSFile object into a ByteArrayOutputStream object?

There was an easy way to do it with gridFSDBFile, but not anymore. //This used to return a GridFSDBFile type. Returns GridFSFile now. GridFSFile gridFsFile = gridFsTemplate.findOne(new Query(...
0
votes
0answers
30 views

Stream provider is not defined. It must be set before writing first bytes to the entity output stream

I am trying to modify my all response's. To achieve that i am using jerseys ContainerResponseFilter. however i am getting this exception "Stream provider is not defined. It must be set before writing ...
1
vote
3answers
351 views

Java - How to use PrintStream/OutputStream to print to the Command Line

I know we can use PrintStream to print lines to a given file: PrintStream output; output = new PrintStream("./temp.txt"); output .println("some output text"); However, can we use ...
1
vote
3answers
42 views

Junit test failed for user-defined object Serialization

After running a Junit test for user-defined object serialization, it was failed and gave me the results Expected: com.me.Position@7a92922 Actual: com.me.Position@25618e91 I have defined the ...
1
vote
2answers
73 views

Unable to write to a file till some specific line

I am trying to split files from one file to 4 different files. So I am dividing the file by some "x" value and wanna write the file till that value and from there to next file continues till the file ...
0
votes
1answer
29 views

Already connected: but no output

URL url2 = new URL("https://win-artl-dev.my.com/rap/opu/odata/ACNLQD/ALPS_SRV/CourseSet"); HttpURLConnection connection2 = (HttpURLConnection) url2.openConnection(); ...
0
votes
1answer
45 views

I'm getting android.os.NetworkOnMainThreadException and another unknown exception from the OutputStreamWriter()

I am getting exceptions for NetworkOnMainThreadException and an unknown exception from the OutputStreamWriter(). This class is responsible for connecting to an SQL database via PHP script http://213....
1
vote
4answers
62 views

How to close a Java's socket's outputstream while keeping the inputstream open to get a result?

I'm sending a message to a server, which passes correctly. But, when trying to read the result, I get an exception that the Socket is closed. Any idea how to close the socket's outputstream while ...
0
votes
0answers
24 views

Ajax response contains struts2 tags which are not translated

I am using an ajax request that constructs a modal box on the server side. The content of the modal box will contain a "calculated" link, surrounded with a form : StringBuffer htmlBuffer = new ...
1
vote
1answer
25 views

How manage correctly a OutputStream to avoid resource leak errors

I have been stuck with this problem for a while, I have read some tutorials and documentations of how implement an inputStream variable and its life cycle, nevertheless I get over an over again the ...
0
votes
2answers
52 views

Modify an InputStream and convert it to Outputstream

Im developing a program where i receive an XML file as InputStream. I have to make some changes and then return it as OutputStream. Here is my code: public void execute (InputStream xmlEntrada, ...
0
votes
0answers
33 views

TWISTED server player position lag

Im currently making a multiplayer game, I'm sending over the users X position via InputStream and OutputStream... I'm getting lots of lag on the client side receiving. Heres the code: First checking ...
0
votes
0answers
38 views

Displaying a picture in an image control from stream

I created a page ImageResizer.aspx that calls the function ResizeImage(bmSource, intWidth) on Page_Load and resizes the image and returns the output as Drawing.Bitmap Private Sub ImageResizer_Load(...
1
vote
0answers
30 views

readLine is null in Server Socket programming

I'm working on a java server socket program, and the in.readLine() from the BufferedReader is null. I tried successfully debugging the program, but could not find why the BufferedReader in.readline() ...
0
votes
2answers
34 views

arabic letters turns ?? in excel using java

I am creating an excel file and I have data in String builder which is a mix of arabic and english and when i print in console it is displaying correctly but when I write it to file arabic letters ...
0
votes
0answers
21 views

How to make OutputStream.write modifies the file instead of overwriting?

I have code that serializes objects and writes the result in the file, the problem is every time when I run the code, the file will be overwritten, How to make outputStream.write modifies the file ...
1
vote
1answer
31 views

Extra odd symbols are added to serialization output

I am trying to serialize a string object by writing my own code to get a byte array of that object instead of using string.getBytes() but I am getting extra odd symbols in the output as follows The ...
0
votes
0answers
12 views

Arabic Font issue when writing data to excel file using outputsteam in JAVA

My java version is 1.6 I have a Data(mix of english and arabic) in string builder and I am creating an excel file and writing it using outputStream When I open the created excel file I can see ...
2
votes
0answers
41 views

How to Convert a user defined object to byte array [duplicate]

I am trying to convert an object called lineId that defined by me to byte array in order to feed it back to OutputStream.write static void serialize(IACLineSegment objectToSerialze, OutputStream ...