*
* @throws java.io.IOException
*/
public TypeDescriptor load(CapInputStream in) throws UnableToReadCapFileException {
TypeDescriptor typeDescriptor = new TypeDescriptor();
// nibbleCount reading
typeDescriptor.setNibbleCount(in.readByte());
// type array reading
typeDescriptor.getType().clear();
// there is (nibbleCount +1)/2 elements in type array
for (int i = 0; i < (typeDescriptor.getNibbleCount() + 1) / 2; i++) {
typeDescriptor.getType().add(in.readByte());
}
return typeDescriptor;
}