Package fr.xlim.ssd.capmanipulator.library

Examples of fr.xlim.ssd.capmanipulator.library.StaticFieldComponent


public class StaticFieldComponentRead extends ComponentRead {

    public Component load(CapInputStream in) throws UnableToReadCapFileException {

        StaticFieldComponent staticFieldComponent = new StaticFieldComponent();

        super.load((byte) ComponentEnum.STATIC_FIELD_COMPONENT.getValue(), in, staticFieldComponent);

        // we reset the count of byte read to zero
        in.resetCount();

        staticFieldComponent.setImageSize(in.readShort());
        staticFieldComponent.setReferenceCount(in.readShort());
        staticFieldComponent.setArrayInitCount(in.readShort());

        staticFieldComponent.setArrayInit(new ArrayList<ArrayInitInfo>(staticFieldComponent.getArrayInitCount()));

        for (int i = 0; i < staticFieldComponent.getArrayInitCount(); i++) {

            ArrayInitInfo ar = new ArrayInitInfoRead().load(in);
            staticFieldComponent.getArrayInit().add(ar);
        }

        staticFieldComponent.setDefaultValueCount(in.readShort());
        staticFieldComponent.setNonDefaultValueCount(in.readShort());

        staticFieldComponent.setNonDefaultValues(new ArrayList<Byte>(staticFieldComponent.getNonDefaultValueCount()));

        for (int i = 0; i < staticFieldComponent.getNonDefaultValueCount(); i++) {
            staticFieldComponent.getNonDefaultValues().add(in.readByte());
        }

        checkSize(in, staticFieldComponent);

        return staticFieldComponent;
View Full Code Here


                break;

            case STATIC_FIELD_COMPONENT:
                logger.debug(LogType.COMPONENT.getMarker(), "Found Static Field Component");
                StaticFieldComponent st = (StaticFieldComponent) new StaticFieldComponentRead().load(inputStream);
                capFile.getComponents().add(st);
                break;


            case REFERENCE_LOCATION_COMPONENT:
View Full Code Here

TOP

Related Classes of fr.xlim.ssd.capmanipulator.library.StaticFieldComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.