Package java.io

Examples of java.io.DataInputStream.skipBytes()


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

        // read methods
        int method_count = dis.readShort();
View Full Code Here


            String attr_name = Utils.getUTF8Value(constantPool, attr_id);
            if (AttributeInfo.SOURCE_FILE.equals(attr_name)) {
                int name_index = dis.readShort();
                sourceFile = ((Utf8CPInfo) constantPool.getEntry(name_index)).getValue();
            } else {
                dis.skipBytes(len);
            }
        }
    }

    public int getAccess() {
View Full Code Here

        fullname = ((ClassCPInfo) constantPool.getEntry(this_class)).getClassName().replace('/', '.');
        /* int super_class = */ dis.readShort();

        // skip interfaces...
        int count = dis.readShort();
        dis.skipBytes(count * 2); // short

        // skip fields...
        int numFields = dis.readShort();
        for (int i = 0; i < numFields; i++) {
            // 3 short: access flags, name index, descriptor index
View Full Code Here

    {
        // BMP format explained here:
        // http://www.javaworld.com/article/2077561/learn-java/java-tip-60--saving-bitmap-files-in-java.html
        // we skip 38 bytes and then read two 4 byte-integers and reverse the bytes
        DataInputStream dis = new DataInputStream(new FileInputStream(new File(filename)));
        int skipped = dis.skipBytes(38);
        assertEquals("Can't skip 38 bytes in image file " + filename, 38, skipped);
        int pixelsPerMeter = Integer.reverseBytes(dis.readInt());
        int actualResolution = (int) Math.round(pixelsPerMeter / 100.0 * 2.54);
        assertEquals("X resolution doesn't match in image file " + filename,
                expectedResolution, actualResolution);
View Full Code Here

    // deal with padding
    int offset = (int)logBytes & 3;
    if (offset > 0) {
        offset = 4 - offset;
        logBytes += offset;
        din.skipBytes(offset);
    }
    updateLen = din.readInt();

      // while
  } catch (EOFException e) {
View Full Code Here

            // center torso criticals
            for (int x = 0; x < 12; x++) {
                ctCriticals[x] = readUnsignedInt(dis);
            }

            dis.skipBytes(4);

            int fluffSize = 0;
            fluff = "Overview:\n\r";
            buffer = new byte[readUnsignedShort(dis)];
            dis.read(buffer);
View Full Code Here

            if (fluffSize <= 60) {
                fluff = null;
            }

            // non printing notes
            dis.skipBytes(readUnsignedShort(dis));
            dis.skipBytes(readUnsignedShort(dis));

            dis.skipBytes(8); // mechs with supercharger have an 01 in here,
            // but we can identify from the criticals
View Full Code Here

                fluff = null;
            }

            // non printing notes
            dis.skipBytes(readUnsignedShort(dis));
            dis.skipBytes(readUnsignedShort(dis));

            dis.skipBytes(8); // mechs with supercharger have an 01 in here,
            // but we can identify from the criticals

            // Get cockpit and gyro type, if any.
View Full Code Here

            // non printing notes
            dis.skipBytes(readUnsignedShort(dis));
            dis.skipBytes(readUnsignedShort(dis));

            dis.skipBytes(8); // mechs with supercharger have an 01 in here,
            // but we can identify from the criticals

            // Get cockpit and gyro type, if any.
            if (rulesLevel > 2) {
                gyroType = readUnsignedShort(dis);
View Full Code Here

            // Get cockpit and gyro type, if any.
            if (rulesLevel > 2) {
                gyroType = readUnsignedShort(dis);
                cockpitType = readUnsignedShort(dis);
                dis.skipBytes(16);
                targSys = readUnsignedShort(dis);
            } else {
                gyroType = Mech.GYRO_STANDARD;
                cockpitType = Mech.COCKPIT_STANDARD;
            }
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.