Method: Java::ObjectInputStream#readBlockData
- Defined in:
- lib/javaobs.rb
#readBlockData ⇒ Object
Read a Java block of data with a size and then the following data.
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/javaobs.rb', line 192 def readBlockData byte = readByte size = nil case byte when TC_BLOCKDATA size = readByte when TC_BLOCKDATALONG size = readInt else raise SerializationError, "Expecting TC_BLOCKDATA" unless byte == TC_BLOCKDATA end data = @str.read(size) byte = readByte raise SerializationError, "Unexpected byte #{byte}" unless byte == TC_ENDBLOCKDATA data end |