0
@@ -39,7 +39,7 @@ module WDDX
0
if obj.respond_to?(:read)
0
return deserialize(obj.read)
0
- return deserialize(obj)
0
@@ -96,7 +96,7 @@ module WDDX
0
- self.instance_variables.collect {|var| hash[var.gsub(/@/, "")] = instance_variable_get(var)}
0
+ hash = self.instance_variables.sort.inject({}) {|h, var| h[var.to_s.gsub(/@/, "")] = instance_variable_get(var); h}
0
@@ -128,7 +128,6 @@ module WDDX
0
# object after decoding. It can also be used for efficient allocation of
0
# memory during the decoding process.
0
class Binary < WddxData
0
attr_accessor :bin_data
0
# Initialize with the raw binary data (to be encoded with Base64)
0
@@ -139,7 +138,7 @@ module WDDX
0
- @bin_data = Base64.decode64(arg)
0
+ @bin_data = arg.unpack( 'm' )[0]
0
# length of the raw binary data in bytes
0
@@ -151,7 +150,7 @@ module WDDX
0
# Returns an Base64 encoded string
0
return @_data unless @_data.nil?
0
- @_data = Base64.encode64(@bin_data).chomp unless @bin_data.nil?
0
+ @_data = [@bin_data].pack( 'm' ).chomp if @bin_data
0
@@ -166,4 +165,4 @@ module WDDX
0
-[WDDX::Struct, WDDX::Binary, WDDX::RecordSet].each {|clazz| clazz.class_eval { include WDDX::Core } }
0
\ No newline at end of file
0
+[WDDX::Struct, WDDX::Binary, WDDX::RecordSet].each {|clazz| clazz.class_eval { include WDDX::Core } }
Comments
No one has commented yet.