public class AppletComponentRead extends ComponentRead {
@Override
public Component load(CapInputStream in) throws UnableToReadCapFileException {
AppletComponent appletComponent = new AppletComponent();
// we first read tag and size
super.load((byte) ComponentEnum.APPLET_COMPONENT.getValue(), in, appletComponent);
// we reset the count of byte read to zero
in.resetCount();
// count reading
appletComponent.setCount(in.readByte());
appletComponent.setApplets(new LinkedList<CapApplet>());
for (int i = 0; i < appletComponent.getCount(); i++) {
CapApplet ap = new CapAppletRead().load(in);
appletComponent.getApplets().add(ap);
}
checkSize(in, appletComponent);
return appletComponent;