objectinputstream Questions

2

There are two similar methods in the Java ObjectInputStream: readUnshared() and readObject() The documentation states: public Object readUnshared() throws IOException, ClassNotFoundException...

4

why does System.out.println(e.getCause()); gives null? And can store whole HashSet collection like this? private void saving() throws IOException, ClassNotFoundException { ObjectOutputStream out ...
Conjurer asked 28/5, 2011 at 0:18

2

Ok so , i have a thread class called 'Client' every time the server accepts a connection it creates a new Client....The run method listens for messages from the client and i am useing ObjectInputSt...
Fleshy asked 11/8, 2011 at 7:4

2

Solved

public class SerProg { static ServerSocket ser=null; static Socket cli=null; static ObjectInputStream ins=null; static ObjectOutputStream outs=null; public static void main(String[] args) ...
Quietly asked 1/1, 2013 at 13:45

6

Solved

Is it not possible to append to an ObjectOutputStream? I am trying to append to a list of objects. Following snippet is a function that is called whenever a job is finished. FileOutputStream fos ...
Unmentionable asked 28/7, 2009 at 14:51

1

ObjectInputStream.readFields() is eligible only within private void readObject(ObjectInputStream) method. public ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException...

2

Solved

I want to maintain database of users of a Bank for my project. I am able to save the number of users in one serializable file. But when I try to save the user to database it adds only the latest on...

10

I have downloaded Eclipse and tried to create a sample servlet program but I got following error The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required...
Decanter asked 1/5, 2016 at 5:2

9

Solved

I am trying to read the number of line in a binary file using readObject, but I get IOException EOF. Am I doing this the right way? FileInputStream istream = new FileInputStream(fileName); Objec...
Dissoluble asked 12/4, 2010 at 23:50

2

I am running into an OOM when reading a large number of objects from an ObjectInputStream with readUnshared. MAT points at its internal handle table as the culprit, as does the OOM stack trace (at ...
Tomaso asked 11/3, 2017 at 9:6

3

Solved

I have written the following code which writes 4000 bytes of 0s to a file test.txt. Then, I read the same file in chunks of 1000 bytes at a time. FileOutputStream output = new FileOutputStream("te...
Astrogeology asked 29/11, 2015 at 6:24

11

Solved

I'm going crazy, I created a file object, so it can be read with ObjectInputStream, and I placed the assets folder. The method works with a file smaller than 1M, and give error with larger files. I...
Kanaka asked 18/5, 2010 at 18:56

3

Solved

I am writing a multiplayer game for Android phones. Communication is via Bluetooth. I have managed to send bytes from one phone to the other using the input / output stream. Since I need to be able...
Tremendous asked 9/4, 2011 at 12:56

1

Solved

I am trying to add an object( of OneChatMessage class) into a file on every button click. And then i try to read all the objects from the file and load it into a ArrayList. But i get a Stream...

2

Solved

I have a huge file with a list of objects written by ObjectOutputStream, one after another. for (Object obj : currentList){ oos.writeUnshared(obj); } Now I want to read this file using ObjectI...
Melentha asked 25/2, 2014 at 8:21

5

Solved

I have some pretty standard code which takes in a serialized object from a stream, which bascially looks like this: Object getObjectFromStream(InputStream is) { ObjectInputStream ois = new Obje...
Isreal asked 24/3, 2011 at 15:50

5

Solved

What's the main difference between the two? Still both of them are for writing Strings. public void writeUTF(String str) throws IOException Primitive data write of this String in modified UTF...
Educate asked 1/8, 2013 at 14:5

2

Solved

I am feeling really stupid right now guys.... basically I am connecting over TCP on a local machine... and when I try to make the In/out streams at the client it wont get passed creating the object...
Us asked 1/10, 2011 at 19:18

4

I'm getting the following violation reported by StrictMode in Android. 02-05 04:07:41.190: ERROR/StrictMode(15093): A resource was acquired at attached stack trace but never released. See java....
Afrikander asked 1/3, 2012 at 11:36

2

I have an application with client server architecture. The client use Java Web Start with Java Swing / AWT and the sert uses HTTP server / Servlet with Tomcat. The communication is made from the...
Kaseykasha asked 20/3, 2010 at 2:25

4

Solved

As for now I will get java.io.StreamCorruptedException when I try to append an Object. I have searched the Internet for a way to overcome that. The answer I found so far is it can't be done. ...
Betimes asked 19/1, 2010 at 15:37

1

Solved

So right now, I have a server that is running with ObjectInputStream and ObjectOutputStream. The problem I am having is that I have a custom (anonymous) class that extends java.lang.Date that I am...

1

Solved

This SocketException is thrown in ObjectInputStream.readObject() method, what cause this excetpion? Besides, the values of soTimeout of client and server socket are both 0, and KeepAlive value is f...
Madaih asked 18/1, 2012 at 2:41

3

I'm just learning networking from a java book, so I'm a bit of a noob. I couldn't find this problem in the book or online so I decided to ask the internet. The book says to use the ObjectOut...
Spidery asked 15/6, 2011 at 2:56

3

Solved

I have read various blogs about Serialization and the use of serialVersionUID. Most of them mention using it to maintain the state of a serializable class. The scenario I have is; I know the old ...
Impropriate asked 15/2, 2011 at 15:6

© 2022 - 2025 — McMap. All rights reserved.