question « serialize « Java I/O Q&A





1. Java serialization question with backward compatibility    stackoverflow.com

I have a question about Java serialization in scenarios where you may need to modify your serializable class and maintain backward compatibility. I come from deep C# experience, so please allow me ...

2. Serializable Question    coderanch.com

Nischal is right... also, your Dodad reference doesn't have to be Serializable or Remote either. Your client gets a stub to whatever Remote object has remoteMethod(). When remoteMethod() on the stub is called, the stub calls the *real* remoteMethod() on your Remote class running on the server. Objects that are reference *inside* remoteMethod() don't have to be Serializable or Remote... only ...

3. Serialization question    coderanch.com

4. Basic Java Serialization question    coderanch.com

Hi, In what order do parameters of a class get serialized using writeObject(ObjectOutputStream) Assume a class Person: class Person { private int age; private String firstName; private String lastName; private String hometown; .... } SO when I do the foll: Person p; p.writeObject(oostream); Will the parameters get written in the order they are declared in the class? i.e. age, firstName, lastName, ...

5. Help nedded !!!question all about serialization    coderanch.com

I want to know how serialization is done internally with primitives(int,long,float,boolean) and primitive objects Long,Integer,Float..) I have seen the forums that they use java.io.DataOutputStream and they have writeInt,writeFloat methods for primitives types.But still not clear does DataInputStream implements Serializable? How internally this works? How primitives are serialized when we make a method call? As far as primitive Objects(Long,Float..) I have seen ...

6. Serialization Question    coderanch.com

I hope someone can explain the result I get from running the following code import java.io.*; public class Model implements Serializable { private static int counter; public Model (){ this.counter = counter + 1; } public int getCounter(){ return counter; } public String toString(){ return String.valueOf(this.counter); } } class TestModel implements Serializable { public static void main (String args[]){ Model m ...

7. Newbie serialization question    coderanch.com

Why should you want to do such a thing as serializing a java.io.InputStream? Maybe I'm making a public display of ignorance but what's the use of serializing an abstract class when there's no object to recover via deserialization? I gather you want to do some basic networking, so I think you need to create a java.net.Socket object and derive your InputStream ...

8. serialization question    coderanch.com

Hi, When you implements Serializable to a class, its super class variables are not serialized. But variables of its sub classes will be serialized automatically. When you deserialize a class whose super class does not implements Serializable then you will not get the actual values of super class's variables. You will get the current value.

9. Serialization | General Questions    coderanch.com

Hi, It is said that through serialization one can persist the state of an object. Q1- What about behaviour? When an object is serialized are only it's attributes persisited or are the methods also sent? Q2- Adding/removing/modifying data type of an existing attribute will automatically update the serialVersionUId of the class. Will performing similar changes to methods also result in the ...





10. serialization question    coderanch.com

I have a question on Serialization. Reference JDK 1.4 Java documentation on ObjectInputStream and ObjectOutputStream. You can create your own trusted streams by extending ObjectInputStream and ObjectOutputStream. And subsitute a non-serializable object with the serializable one, before writing that to output stream. On the reader end you can resolve, the object and return another to the user. Is this the correct ...

11. (De)Serialization question    coderanch.com

i have an object (that implements Serializable-interface) written to a file some days ago. no problems occured. today i wanted to read the object back from the file, but the object that's in the file contains some other members of other classes (all implementing Serializable interface) and some of this classes are changed (new members, methods, etc.) when i try to ...

12. Serialization question    coderanch.com

As it is your writeObject and readObject methods aren't being called because they have the wrong method signitures. Change the access specifiers on your writeObject & readObject methods to private and it will work. import java.io.*; class NsClass { int i; public void setI(int i) { this.i = i; } public int getI() { return this.i; } } public class SerialTest ...

13. Serialization Question    coderanch.com

Hi guys, I'm working on a distributed application. My client side sends over tcp socket , serialized messages.The class that I serialize is called "AgentMessage". Serialization and deserialization seems to work correctly...but I have a question about keeping the state of a field (is a Vector) : I'll post the code to explain the problem...it's very simple : public class AgentMessage{ ...

14. Question about Serialization    coderanch.com

I have 2 classes that implement the same interface and one of them also implements the Serializable interface. Now, when I try to serialize the class to the HD I get an exception (java.io.NotSerializableException). I'm 99% sure that the class is "not serializable" due to the fact that the super class (the interface) is not serializable. If I make the interface ...

15. Question regarding serialization ?    coderanch.com

when a method call is made across network. Method name and its parameters are serialized and send it as a Smart Link request across network. Then does it creates a new instance of class and then call its method. Because in my case, the method is not static. So i assume, to make call for this method, we need a instance ...

16. Question about serialization    coderanch.com





17. Question related to serialization.    coderanch.com

While reading a document on serialization i found that there are two call back methods readObject(ObjectInputStream) and writeObject(ObjectOutputStream) are present which are called by the JVM just before the object is serialized and deserialized. I just wanted to know that when these call back methods are already present then why do we have need for Externalizable interface when we can do ...

18. Question about serialization    coderanch.com

19. Need clarity on a basic question about Serialization    coderanch.com

As we all know that everything in computers is stored in the form of bits and bytes(eventually). So how does this concept of Serialization works, as even if we have normal objects they are in the form of bits and bytes; when we send it from one PC to another PC, it will be sent in the form of bytes and ...

20. Quick question - serialization    coderanch.com

You are right about the SUIDs if the class changes. If the class changes in such a way that the SUID changes, it will only be possible to serialise and de-serialise objects to the same class version. If you write 1L, then you are saying, "I want this regarded as version 1 for ever."

21. serialization question    forums.oracle.com

22. serializable question    forums.oracle.com

I just wanted to be sure about this since I changed around some code in one my my classes then was unable to load it again. In a serializable object, can I change around as much functionality code and static variables as I want as long as I don't alter the global variables and still be able to load a previously ...

23. Serialization - Couple of Questions    forums.oracle.com

Hello, I have a couple of questions about serialization if you someone wouldn't mind answering them: I am in the middle of writing a piece of software and am look to add serialization to save a couple of my collection classes. Overall in the program I'll have about 20 classes, with two collection classes holding a Collection of a type of ...

24. A question about the Serialization    forums.oracle.com

It means that somebody is going to a lot of trouble not to use Serialization in a straightforward way. It may also mean that the code was hopelessly broken in some way, and somebody coded this ghastly workaround, or that the underlying data stream is being read (and was written) on multiple levels rather than just being a simple Object stream. ...

25. Serialization Question    forums.oracle.com

26. Serializable question    forums.oracle.com

Neither is more correct than the other. Even if you don't include the explicit "implements Serializable", simply by virtue of extending a class that does implement Serializable, B also implements it. They are functionally equivalent. It's just a matter of personal preference: Do you prefer to be explicit, so that it's immediately obvious? Or do you prefer to not clutter your ...