Questions tagged [dataoutputstream]

A mechanism for writing abstract data to a stream

A DataOutputStream is a mechanism for writing any abstract data to a stream, regardless of the type of the data. 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 DataOutputStream is abstract, and doesn't describe the type of data that is being written. Typically, if you are able to, 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.

257 questions
0
votes
1 answer

Socket DataOutputStream seems only send the first byte correctly

I had to control a Hardware made in C who receive unsigned bytes for control. in order to debug these commands i created some JavaFX interface. I'm having trouble because the hardware is only responding to the fist command i send. To turn On for…
Henrique
  • 35
  • 2
  • 8
0
votes
0 answers

infinite while while reading data from datainputstream

I am transferring image file from server socket to client socket while writing byte on outstream is i do close out stream after writing whole byte data on stream then it work fine but close the socket So from preventing socket close problem i am not…
Nikhil Sharma
  • 593
  • 7
  • 23
0
votes
0 answers

How to send data via socket in Android 7

I'm working on an application which is able to control water station via internet and it works fine on API<24. I today we tried to installed it on new API level 24 and application suddenly stopped. I tried to figure out what was happened on this…
Mohsen Hatami
  • 317
  • 3
  • 14
0
votes
1 answer

How would I save/load this configuration of JButtons?

This is how I add all of my JButtons to the panel and to the arraylist private ArrayList b; String defaultLogo = "O"; for(int i=0; i<81;i++) { b.add(new JButton(defaultLogo)); b.get(i).addActionListener(new…
0
votes
1 answer

Binary I/O Classes (Summing all the integers in a binary data file)

Could someone please help me through this problem? I'm not really good with the binary I/O classes. Suppose a binary data file named Exercise 13b_1.dat has been created using writeInt(int) in DataOutputStream. The file contains an unspecified…
0
votes
1 answer

java object streams

I'm trying to create a server in java which will maintain up to 4 connections simultaneously. I thought that holding the relevant information in an array would serve my purpose, well, but I'm having some trouble. Here is the class I've…
Rolan
  • 2,924
  • 7
  • 34
  • 46
0
votes
0 answers

Java sockets readFully() DataInputStream hangs on 2nd iteration of loop

Here is the deal. I gotta program a little client/server chat app. The constraint is that i have to send the data from one to another under a packet form. The packet is composed as follow : size ( 1byte) idClient (5bytes) opCode(1Byte) and…
Tirvax
  • 35
  • 1
  • 10
0
votes
3 answers

How to read byte[] of variable size from DataInputStream in Java?

I'm working on a TCP server project and I need to transfer a file via a byte[] using a DataOutputStream and a DataInputStream and I've gotten stuck. I'm able to write the byte array to the output stream with no problems, but I was looking at the…
jmon117
  • 65
  • 8
0
votes
1 answer

Socket not flushing data

I did a script to exchange data between a client and a server with socket on specific port. In order, I am expecting: Server is listening Client opens a socket Server akwnoledges by sending a int -> never received ! I just noticed that my client…
Anduriel
  • 93
  • 2
  • 10
0
votes
2 answers

Save and read file with stream on BlackBerry

Argument 'address' is the string "CepVizyonVersionFile", and after Connector.openDataInputStream(address) the program throws an exception with message: no ' : ' in URL. What format should address be in? public void saveLocal(String fileString,…
atasoyh
  • 3,045
  • 6
  • 31
  • 57
0
votes
1 answer

It possible to integrate Orkut like using Oauth like Facebook and Twitter

As per information i have, Aouth provides very stander plateform for authentication for accessing thirdpary social networking website like Facebook, Twitter and LinkedIn. Is it possible to Orkut integration with Website for third party user in PHP.…
Haresh Vidja
  • 8,340
  • 3
  • 25
  • 42
0
votes
2 answers

Java DataOutputStream doesnt write all messages ( TCP Socket )

in my Client-Server application I found a strange error. I got the following Methods : sendLoginResponse(); sendPlayerList(); sendCurrentLevelState(); Each Methods sends a byte array to the Client-Side If I only call 2 of them, everything works…
Moritz Schmidt
  • 103
  • 2
  • 6
0
votes
0 answers

Sending multiple messages with DataOutputStream

I'm trying to send 3 messages from an Android tcp client to a C# Server. It works properly in another C# client, but it doesn't in the Android client. I send 3 messages but the server gets the first message correctly but then the second and the…
Alessandro
  • 89
  • 2
  • 9
0
votes
2 answers

Extending dataOuputStream in android

Hi I am using custom dataOutputStream as requestStream in android. I found warning right after I created extended class. public class RequestStream extends DataOutputStream{ /** * Constructs a new {@code DataOutputStream} on the {@code…
0
votes
1 answer

Can't get sockets' DataOutputStream in loop for sockets list

I am trying to create a client/server program with Java where clients send simple string to server and each client connected to server gets this String. So I created 2 server classes for server which create new thread for each client and listen to…
Alexey Rumin
  • 193
  • 1
  • 6
  • 17