Package java.io

Examples of java.io.DataInputStream.skip()


        Assert.assertEquals(before, after);
      }
     
      //assert that the end of input is reached
      try {
        long skipped = dis.skip(1);
        Assert.assertEquals(0, skipped);
      }catch (EOFException expected) {
        //either should throw exception or return 0 as skipped
      }
    }finally {
View Full Code Here


            for (int i = 0; i < lastIndex; i++) {

                //dis.seek(recOffset[i]);
    dis.reset();
    dis.skip(recOffset[i]);
                len = recOffset[i+1] - recOffset[i];
                bytes = new byte[len];
                dis.readFully(bytes);
                recArray[i] = new Record(bytes, recAttrs[i]);
            }
View Full Code Here

    
            // last record
         
            dis.reset();
      len = (int) dis.available() - recOffset[lastIndex];
      dis.skip(recOffset[lastIndex]);    
      bytes = new byte[len];
            dis.readFully(bytes);
            recArray[lastIndex] = new Record(bytes, recAttrs[lastIndex]);
        }
 
View Full Code Here

        Assert.assertEquals(before, after);
      }
     
      //assert that the end of input is reached
      try {
        long skipped = dis.skip(1);
        Assert.assertEquals(0, skipped);
      }catch (EOFException expected) {
        //either should throw exception or return 0 as skipped
      }
    }finally {
View Full Code Here

            ByteArrayInputStream bin = new ByteArrayInputStream(baout.toByteArray());
            DataInputStream din = new DataInputStream(bin);
            long len = din.readInt() & 0xFFFFFFFFL;
            println("Length: " + len);
            din.skip(4); //checksum
            int tidLen = din.readUnsignedShort() - 2;
            byte[] tid = new byte[tidLen];
            din.readFully(tid);
            String filename = new String(tid, "ISO-8859-1");
            int asciiCount1 = countUSAsciiCharacters(filename);
View Full Code Here

            for (int i = 0; i < lastIndex; i++) {

                //dis.seek(recOffset[i]);
    dis.reset();
    dis.skip(recOffset[i]);
                len = recOffset[i+1] - recOffset[i];
                bytes = new byte[len];
                dis.readFully(bytes);
                recArray[i] = new Record(bytes, recAttrs[i]);
            }
View Full Code Here

    
            // last record
         
            dis.reset();
      len = (int) dis.available() - recOffset[lastIndex];
      dis.skip(recOffset[lastIndex]);    
      bytes = new byte[len];
            dis.readFully(bytes);
            recArray[lastIndex] = new Record(bytes, recAttrs[lastIndex]);
        }
 
View Full Code Here

            for (int i = 0; i < lastIndex; i++) {

                //dis.seek(recOffset[i]);
    dis.reset();
    dis.skip(recOffset[i]);
                len = recOffset[i+1] - recOffset[i];
                bytes = new byte[len];
                dis.readFully(bytes);
                recArray[i] = new Record(bytes, recAttrs[i]);
            }
View Full Code Here

    
            // last record
         
            dis.reset();
      len = (int) dis.available() - recOffset[lastIndex];
      dis.skip(recOffset[lastIndex]);    
      bytes = new byte[len];
            dis.readFully(bytes);
            recArray[lastIndex] = new Record(bytes, recAttrs[lastIndex]);
        }
 
View Full Code Here

        // skip fields...
        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();
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.