读取一个对象 :return:
(self)
| 206 | |
| 207 | @ranges((0x60, 0x6f), ord('O')) |
| 208 | def read_object(self): |
| 209 | """ |
| 210 | 读取一个对象 |
| 211 | :return: |
| 212 | """ |
| 213 | result = {} |
| 214 | self.objects.append(result) |
| 215 | value = self.read_byte() |
| 216 | if 0x60 <= value <= 0x6f: |
| 217 | ref = value - 0x60 |
| 218 | else: |
| 219 | ref = self.read_int() |
| 220 | field_names = self.field_names[ref] |
| 221 | for field_name in field_names: |
| 222 | field_value = self.read_next() |
| 223 | result[field_name] = field_value |
| 224 | |
| 225 | path = self.paths[ref] |
| 226 | if path == 'java.math.BigDecimal': |
| 227 | result = float(result['value']) or 0 |
| 228 | self.objects[-1] = result |
| 229 | elif path == 'java.math.BigInteger': |
| 230 | result = int(result['value']) |
| 231 | self.objects[-1] = result |
| 232 | |
| 233 | return result |
| 234 | |
| 235 | @ranges(ord('C')) |
| 236 | def read_class(self): |
no test coverage detected