Results 1 to 2 of 2
  1. #1
    jamesd128 is offline Member
    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    Default Size of serialized object with null values

    I want to create a serializable object with many different fields, but where, in any given object, only a few of those fields will have values. What I'm wondering is, when I write one of those objects to a file, will the file be a smaller size because only a few of the fields have values or will it be a bigger file to accommodate all the fields present on the object even if they are null?

  2. #2
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    4

    Default

    I believe invisible space takes up bytes, so yes, pending on the amount of space you place between each field.

    The only way to determine would be trial and error.
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

Similar Threads

  1. Printing memory addresses and null values
    By Ben1 in forum New To Java
    Replies: 21
    Last Post: 10-11-2010, 05:05 PM
  2. JSP/Ajax/Post giving null values
    By Mange in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 04-22-2010, 10:02 PM
  3. cant print 2d array(giving null values)
    By fneeks in forum New To Java
    Replies: 1
    Last Post: 04-07-2010, 08:48 PM
  4. null values
    By jabo in forum New To Java
    Replies: 3
    Last Post: 03-31-2010, 03:44 PM
  5. How to get null values stored in array
    By Ms.Ranjan in forum New To Java
    Replies: 4
    Last Post: 05-21-2009, 10:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •