Package fr.xlim.ssd.capmanipulator.library

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


     * @throws java.io.IOException
     */

    public ClassInfo load(byte bitfield, CapInputStream in) throws UnableToReadCapFileException {

        ClassInfo classInfo = new ClassInfo();

        classInfo.setFlags(bitfield);

        // superClassRef loading
        classInfo.setSuperClassRef(new ClassRefRead().load(in));

        // declaredInstancedSize reading
        classInfo.setDeclaredInstanceSize(in.readByte());

        // firstRefToken reading
        classInfo.setFirstReferenceToken(in.readByte());

        // refCount reading
        classInfo.setReferenceCount(in.readByte());

        // publicMethodTableBase reading
        classInfo.setPublicMethodTableBase(in.readByte());

        // publicMethodTableCount reading
        classInfo.setPublicMethodTableCount(in.readByte());

        // packageMethodTableBase reading
        classInfo.setPackageMethodTableBase(in.readByte());

        // packageMethodTableCount reading
        classInfo.setPackageMethodTableCount(in.readByte());

        // publicVirtualMethodTable reading
        classInfo.getPublicVirtualMethodTable().clear();

        for (int i = 0; i < classInfo.getPublicMethodTableCount(); i++) {
            classInfo.getPublicVirtualMethodTable().add(in.readShort());

        }

        // packageVirtualMethodTable reading
        classInfo.getPackageVirtualMethodTable().clear();

        for (int i = 0; i < classInfo.getPackageMethodTableCount(); i++) {
            classInfo.getPackageVirtualMethodTable().add(in.readShort());
        }

        // interfaces reading
        classInfo.getInterfaces().clear();

        // the number of entries entries in the interfaces array
        // is in the second nibble of the bitField
        byte interfaceCount = (byte) (bitfield & 0x0F);

        for (int i = 0; i < interfaceCount; i++) {
            ImplementedInterfaceInfo impInt = new ImplementedInterfaceInfoRead().load(in);
            classInfo.getInterfaces().add(impInt);
        }

        // remoteInterfaces reading
        // only if the ACC_REMOTE flag has the value 0


        if ((bitfield & ClassComponent.ACC_REMOTE) == ClassComponent.ACC_REMOTE) {
            classInfo.setRemoteInterfacesInfo(new RemoteInterfaceInfoRead().load(in));
        } else {
            classInfo.setRemoteInterfacesInfo(null);
        }

        return classInfo;
    }
View Full Code Here


            // 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);
            }
        }

View Full Code Here

TOP

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

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.