def stream
      if top_parent.is_a?(DObject)
        return top_parent.stream
      else
        return Stream.new(nil, file_endian=false)
      end
    end
def stream
      if top_parent.is_a?(DObject)
        return top_parent.stream
      else
        return Stream.new(nil, file_endian=false)
      end
    end
Returns a Stream instance which can be used for encoding a value to binary.

 @note Retrieves the Stream instance of the top parent DObject instance.
   If this fails, a new Stream instance is created (with little endian encoding assumed).