Yaakov Chaikin wrote:
As for the question, I'd expect a null object reference to be 24 bit, which
should be smaller than most primitives.

That's useful info. How do you know this? I just want some way to verify this.

"24 bit" didn't sound likely to me, so I checked. Compare the serialized forms of these two trivial examples:

public class IntMember implements Serializable {
    private int myField;
}

serializes to 'M-,[EMAIL PROTECTED]@^Ntest.IntMember^P?2M->[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@'

public class IntegerMember implements Serializable {
    private Integer myField;
}

serialises to 'M-,[EMAIL PROTECTED]@^Rtest.IntegerMember2lM-(&[EMAIL PROTECTED]@[EMAIL PROTECTED]/lang/Integer;xpp'

So the serialized form of a null reference depends on the length on the fully qualified class name and is thus (somewhat) unconstrained.

The Java Serialization Specification is the place to look for verification if empiracle proof isn't enough.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to