Package fr.xlim.ssd.capmanipulator.library

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



    @Override
    public Component load(CapInputStream in) throws UnableToReadCapFileException {

        ClassComponent classComponent = new ClassComponent();

        // we first read tag and size
        super.load((byte) ComponentEnum.CLASS_COMPONENT.getValue(), in, classComponent);

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

        // TODO: signaturePoolLength only on Java Card 2.2
        /*
        * //signaturePoolLength reading
        * //this.setSignaturePoolLength(in.readShort());
        * this.setSignaturePoolLength(in.readShort()); nbByteRead += 2;
        *
        * //we first clear the signaturePool signaturePool.clear(); for(int
        * i=0; i<signaturePoolLength; i++){ signaturePool.add(new
        * TypeDescriptor(in)); }
        */

        classComponent.setSignaturePool(new ArrayList<TypeDescriptor>());
        classComponent.setClasses(new ArrayList<ClassInfo>());
        classComponent.setInterfaces(new ArrayList<InterfaceInfo>());


        while (in.getByteRead() < classComponent.getSize()) {

            // we'll have to check the first nibble to know if it's a
            // classInfo or
            // interfaceInfo structure
            byte buf = in.readByte();

            // if the most significant bit of buf is 1 it's an interfaceInfo
            // else it's a classInfo
            if ((buf & ClassComponent.ACC_INTERFACE) != 0) {
                InterfaceInfo intInf = new InterfaceInfoRead().load(buf, in);
                classComponent.getInterfaces().add(intInf);
            } else {
                ClassInfo classInf = new ClassInfoRead().load(buf, in);
                classComponent.getClasses().add(classInf);
            }
        }


        checkSize(in, classComponent);
View Full Code Here


                break;

            case CLASS_COMPONENT:
                logger.debug(LogType.COMPONENT.getMarker(), "Found Class Component");
                ClassComponent cl = (ClassComponent) new ClassComponentRead().load(inputStream);
                capFile.getComponents().add(cl);
                // we add the offset to the method componentTab
                // contained in the class componentTab
                for (ClassInfo c : cl.getClasses()) {
                    Converter.addArrayToArray(c.getPublicVirtualMethodTable(), lOffset);
                }

                break;
View Full Code Here

TOP

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

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.