Questions tagged [objectoutputstream]

The Java ObjectOutputStream serialization class from the Java standard library.

ObjectOutputStream is a class from the Java standard library that can be used to serialize and write objects previously that can later be read and deserialized by an ObjectInputStream instance.

566 questions
-1
votes
1 answer

Errorwhen WriteObject from Server To Socket

Some one help me this this exception when send object from server to client it is NotSerializableException << and i try to solve the error and implements the interface Serializable and same exception >> >>> > /* * To change this license…
-1
votes
1 answer

ObjectOutputStream can't write my object

I'm making a group-chatting program by using socket but cant write my Message object into the socket objectOutputStream. The server side objectInputStream found nothing (avalible = 0). I have try to flush but it dosen't work. Please help guy. enum…
-1
votes
1 answer

Java - TCP client/server using ObjectOutputStream and threading

I am trying to develop some kind of chat application (learning purposes) but when I send my objects from the client to the server only the first one seems to get received. No error is shown or nothing so I don't really know whats wrong. Server…
John
  • 728
  • 2
  • 15
  • 37
-1
votes
1 answer

ObjectInput and OutputStream error when writing in to a file

So i am programming a plugin for Minecraft Spigot but i get an Java error so that's why I'm not posting it on a minecraft plugins forum, but anyway I'm trying to save a class called GroupManager into a File (With a class called ObjectData) And after…
Rof
  • 53
  • 1
  • 5
-1
votes
2 answers

How does ObjectOutputStream call writeObject when the object is very large?

I have a large file that needs to be transferred over socket from server to client. If I want to use writeObject in ObjectOutputStream to send the object, what's the normal way to do it? How about reading at the client side?
Ting W
  • 29
  • 1
  • 5
-1
votes
1 answer

Android: Can't append to ObjectOutputFile

I'm trying to store an object to a data file, and I can create the file, but when I try append anything to the file it simply creates a new file and overwrites the old file. My create code: public void createObject(Object object) { //File…
Dan
  • 3
  • 2
-1
votes
1 answer

ObjectInputStream and Apache-Commons-Net FTPClient

I'm trying to read a file from an FTP server accessed with the FTPClient class from the Apache Commons library, but method to get a file retrieveFile(remoteFileName, OutputStream) needs an OutputStream. I'm trying to get the object without first…
-1
votes
2 answers

How to read objects sent over objectOutputStream on a socket server in Java

I have the send working but the server side wont receive the object sent in the data input stream. The class is serialized and works when sending but I'm not sure why it is not being received by the server. Here is my code: Server.ois = new…
Tyler Songer
  • 70
  • 1
  • 9
-1
votes
2 answers

Reset an ObjectOutputStream in Java

I know this problem has been asked previously, but I can't realize how to send an object more than one time with an ObjectOutputStream, I tried what people said in this forum. The thing is I'm developing a Snake game in Java using multithreading and…
Pepe
  • 27
  • 1
  • 1
  • 7
-1
votes
3 answers

How to find if the file exist or not in Android?

I have write the following code to write a file- FileOutputStream fos = context.openFileOutput("MyFile",Context.MODE_PRIVATE); ObjectOutputStream os = new ObjectOutputStream(fos); //Saving my…
-1
votes
1 answer

Android: OptionalDataException upon ObjectInputStream.readObject()

Situation : From my Android server, I'm sending a simple String OBJECT to the client. I use ObjectOutputStream at the server, and ObjectInputStream at the client. Server code: mOutput.flush(); mOutput.reset(); …
-1
votes
1 answer

one single ObjectOutputStream for multiple use with sockets

I'm trying to make a very basic example of a network connection where I use an ObjectOutputStream, ObjectInputStream and sockets. The client sends the string "Hello" to the server. As you see this string is sent 10 times with the very same…
Sheldon
  • 959
  • 2
  • 9
  • 16
-1
votes
1 answer

Can't use InputStream from Socket after writeObject

Here is the situation: I have a ServerSocket ss, and "Socket socket = ss.accept();", then if I do this: istream = socket.getInputStream(); ostream = socket.getOutputStream(); in = new BufferedReader(new InputStreamReader(istream)); out = new…
Marko
  • 1,267
  • 1
  • 16
  • 25
-1
votes
1 answer

Communicating with multiple clients - Java Server

I have implemented a small Java chatroom program, where clients can communicate with the server. Although multiple clients won't work - I believe this is because a client reserves a socket while connected? Is there a simple way to add multiple…
-1
votes
2 answers

Appending Objects to a .txt file

I was trying out a program that was given in the exercise at the end of the chapter 'Serialization'. The program requires me to declare a class Person which encapsulates only two data members of type Name and Address , which are also classes. Then…
A User
  • 375
  • 2
  • 4
  • 13
1 2 3
37
38