javaobs 0.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/lib/CVS/Entries +1 -1
  2. data/lib/javaobs.rb +11 -1
  3. data/rakefile +1 -2
  4. metadata +2 -2
@@ -1,2 +1,2 @@
1
- /javaobs.rb/1.2/Sun Apr 16 22:41:16 2006//
1
+ /javaobs.rb/1.4/Mon Apr 17 04:47:58 2006//
2
2
  D
@@ -237,6 +237,8 @@ module Java
237
237
  def readUID; @str.read(8); end
238
238
  def readLong; @str.read(8).unpack("Q").first; end
239
239
 
240
+ # Read the block data beginning tag and return the size. We can have a long or
241
+ # short block of data.
240
242
  def readBlockStart
241
243
  byte = readByte
242
244
  size = nil
@@ -253,6 +255,7 @@ module Java
253
255
  size
254
256
  end
255
257
 
258
+ # Read the block end tag. Validate it is correct or raise a SerializationError.
256
259
  def readBlockEnd
257
260
  byte = readByte
258
261
  raise SerializationError, "Unexpected byte #{byte}" unless byte == TC_ENDBLOCKDATA
@@ -420,7 +423,10 @@ module Java
420
423
  end
421
424
  end
422
425
 
423
- # Read class data and recursively read parent classes.
426
+ # Read class data and recursively read parent classes. If the class
427
+ # is externalizable then we call the _readJavaData method to '
428
+ # perform the custom serialization. See Java::Util::Hash and
429
+ # Java::Util::Date for an example.
424
430
  def readClassData(klass, object = nil)
425
431
  if object == nil
426
432
  object = klass.rubyClass.new()
@@ -528,6 +534,7 @@ module Java
528
534
  end
529
535
  end
530
536
 
537
+ # Write the beginning of a block tag with the size of the block.
531
538
  def writeBlockStart(size)
532
539
  if (size <= 255)
533
540
  writeByte(TC_BLOCKDATA)
@@ -538,6 +545,7 @@ module Java
538
545
  end
539
546
  end
540
547
 
548
+ # Write the block end tag.
541
549
  def writeBlockEnd
542
550
  writeByte(TC_ENDBLOCKDATA)
543
551
  end
@@ -603,10 +611,12 @@ module Java
603
611
  writeObject(klass.superClass)
604
612
  end
605
613
 
614
+ # Ruby version of the default write object method.
606
615
  def defaultWriteObject(object)
607
616
  writeObjectFields(object.class.javaClass, object)
608
617
  end
609
618
 
619
+ # Internal method to write meta fields to stream.
610
620
  def writeObjectFields(klass, object)
611
621
  klass.fields.each do |f|
612
622
  v = object.send(f.name.intern)
data/rakefile CHANGED
@@ -6,9 +6,8 @@ require 'rake/packagetask'
6
6
  require 'rake/gempackagetask'
7
7
  require 'rake/contrib/rubyforgepublisher'
8
8
 
9
- PKG_BUILD = '3'
10
9
  PKG_NAME = 'javaobs'
11
- PKG_VERSION = '0.3'
10
+ PKG_VERSION = '0.3.1'
12
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
13
12
 
14
13
  RELEASE_NAME = "REL #{PKG_VERSION}"
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: javaobs
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.3"
7
- date: 2006-04-16 00:00:00 -07:00
6
+ version: 0.3.1
7
+ date: 2006-04-17 00:00:00 -07:00
8
8
  summary: Decode Java Serialized Objects to Ruby Objects.
9
9
  require_paths:
10
10
  - lib