Package java.io

Examples of java.io.DataInputStream.readUnsignedShort()


            throw new ClassFormatError("No Magic Code Found "
                + "- probably not a Java class file.");
        }

        // right we have a good looking class file.
        /* int minorVersion = */ classStream.readUnsignedShort();
        /* int majorVersion = */ classStream.readUnsignedShort();

        // read the constant pool in and resolve it
        constantPool = new ConstantPool();

View Full Code Here


                + "- probably not a Java class file.");
        }

        // right we have a good looking class file.
        /* int minorVersion = */ classStream.readUnsignedShort();
        /* int majorVersion = */ classStream.readUnsignedShort();

        // read the constant pool in and resolve it
        constantPool = new ConstantPool();

        constantPool.read(classStream);
View Full Code Here

        constantPool = new ConstantPool();

        constantPool.read(classStream);
        constantPool.resolve();

        /* int accessFlags = */ classStream.readUnsignedShort();
        int thisClassIndex = classStream.readUnsignedShort();
        /* int superClassIndex = */ classStream.readUnsignedShort();
        ClassCPInfo classInfo
            = (ClassCPInfo) constantPool.getEntry(thisClassIndex);
        className  = classInfo.getClassName();
View Full Code Here

        constantPool.read(classStream);
        constantPool.resolve();

        /* int accessFlags = */ classStream.readUnsignedShort();
        int thisClassIndex = classStream.readUnsignedShort();
        /* int superClassIndex = */ classStream.readUnsignedShort();
        ClassCPInfo classInfo
            = (ClassCPInfo) constantPool.getEntry(thisClassIndex);
        className  = classInfo.getClassName();
    }
View Full Code Here

        constantPool.read(classStream);
        constantPool.resolve();

        /* int accessFlags = */ classStream.readUnsignedShort();
        int thisClassIndex = classStream.readUnsignedShort();
        /* int superClassIndex = */ classStream.readUnsignedShort();
        ClassCPInfo classInfo
            = (ClassCPInfo) constantPool.getEntry(thisClassIndex);
        className  = classInfo.getClassName();
    }

View Full Code Here

        /* int version = */ data.readInt();
        // read the constant pool.
        ConstantPool constants = new ConstantPool(data);
        Object[] values = constants.values;
        // read access flags and class index.
        /* int accessFlags = */ data.readUnsignedShort();
        int classIndex = data.readUnsignedShort();
        Integer stringIndex = (Integer) values[classIndex];
        String className = (String) values[stringIndex.intValue()];
        return className;
    }
View Full Code Here

        // read the constant pool.
        ConstantPool constants = new ConstantPool(data);
        Object[] values = constants.values;
        // read access flags and class index.
        /* int accessFlags = */ data.readUnsignedShort();
        int classIndex = data.readUnsignedShort();
        Integer stringIndex = (Integer) values[classIndex];
        String className = (String) values[stringIndex.intValue()];
        return className;
    }

View Full Code Here

        int numFields = dis.readShort();
        for (int i = 0; i < numFields; i++) {
            // 3 short: access flags, name index, descriptor index
            dis.skip(2 * 3);
            // attribute list...
            int attributes_count = dis.readUnsignedShort();
            for (int j = 0; j < attributes_count; j++) {
                dis.skipBytes(2); // skip attr_id (short)
                int len = dis.readInt();
                dis.skipBytes(len);
            }
View Full Code Here

            methods[i] = new MethodInfo();
            methods[i].read(constantPool, dis);
        }

        // get interesting attributes.
        int attributes_count = dis.readUnsignedShort();
        for (int j = 0; j < attributes_count; j++) {
            int attr_id = dis.readShort();
            int len = dis.readInt();
            String attr_name = Utils.getUTF8Value(constantPool, attr_id);
            if (AttributeInfo.SOURCE_FILE.equals(attr_name)) {
View Full Code Here

     */
    public void read(InputStream ins) throws IOException {

        DataInputStream in = new DataInputStream(ins);
        attributes = in.readByte();
        int len = in.readUnsignedShort();
        data = new byte[len];
        in.readFully(data);
    }


View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.