Re: byte representation of a class

From: Kevin McMurtrie (mcmurtri_at_dslextreme.com)
Date: 09/14/04


Date: Mon, 13 Sep 2004 23:31:48 -0700

In article <cd478661.0409131114.6829da2d@posting.google.com>,
 Benjamin.von.Eicken@rwth-aachen.de (Benjamin von Eicken) wrote:

> Hi
>
> How can I get a byte representation of
> a java class?
> I do not want to use the class file.
> Is it possible to get access to the
> byte code?
> ObjectOutputStream does it somehow,
> but I do not want to use serializable
> objects only and I do not want a
> stream.
> So I want to store an instance of an
> object but not in a stream and not
> necessary serializable.
> Is it possible?

No.

> And if, how?
>
> regards
>
> Benjamin von Eicken

Objects use references to other objects to store data. A shallow copy
will loose nearly all data while a deep copy would gather every object
in the heap. Other than a core dump of the entire JVM, there is no way
to make a portable byte representation of a class without serializing
it. Serialization saves relevant data and directives that can be used
to reconstruct a very similar object later.



Relevant Pages

  • Re: A taxonomy of types
    ... "First class types and their representation", ... pointed out in the previous mail I consider that serializing the ... interface of a type comes near to saving part of the program code. ... complicated problem than to specify the representation of something... ...
    (comp.lang.misc)
  • Re: A taxonomy of types
    ... When you serialize just the "representation" you are not able to ... coding, and for the deserialization of complex/constructed types, where the ... requiring prior serializing the class layout, ... for code migration, which would be very problematic at the C level (I have ...
    (comp.lang.misc)
  • Re: A taxonomy of types
    ... integers") but we also use types to refer to more conceptual objects ... "First class types and their representation", ... Interface and representation are important in different contexts. ... Some people think that serializing a type (the type itself and not ...
    (comp.lang.misc)
  • Re: A taxonomy of types
    ... "First class types and their representation", ... pointed out in the previous mail I consider that serializing the ... interface of a type comes near to saving part of the program code. ... but, alas, to fully specify the "meaning" of something is a much more ...
    (comp.lang.misc)
  • Re: A taxonomy of types
    ... "First class types and their representation", ... do we first focus on interface and leave the representation floating?... ... as for the latter issue, most languages tend to make a tradeoff, with some ... Some people think that serializing a type (the type itself and not ...
    (comp.lang.misc)