| 253 | } |
| 254 | |
| 255 | fn read_method(reader: &mut BlockReader, cf: &ClassFragment) -> Result<Method, Error> { |
| 256 | match ClassReader::require_n(reader, 6, |mut r| { (r.get_u16(), r.get_u16(), r.get_u16()) }) { |
| 257 | Ok((flags, n_idx, d_idx)) => match ClassReader::read_attributes(reader, cf) { |
| 258 | Ok(attributes) => Ok(Method { |
| 259 | access_flags: AccessFlags::of(flags), |
| 260 | name_index: ConstantPoolIndex::new(n_idx as usize), |
| 261 | descriptor_index: ConstantPoolIndex::new(d_idx as usize), |
| 262 | attributes: attributes |
| 263 | }), |
| 264 | Err(err) => Err(err) |
| 265 | }, |
| 266 | Err(err) => Err(err) |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | fn read_class_attributes(reader: &mut BlockReader, cf: &ClassFragment) -> Result<ClassFragment, Error> { |
| 271 | match ClassReader::read_attributes(reader, cf) { |