Package java.io

Examples of java.io.DataInputStream.reset()


            int lastIndex = header.numRecords - 1;

            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


                recArray[i] = new Record(bytes, recAttrs[i]);
            }
    
            // 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

            byte[] data1 = new byte[sourceData1.length];
            byte[] data2 = new byte[sourceData2.length];
            in.readFully(data1);
            in.mark(sourceData2.length);
            in.readFully(data2);
            in.reset();
            in.readFully(data2);
            assertTrue(Arrays.equals(sourceData1, data1));
            assertTrue(Arrays.equals(sourceData2, data2));
        } finally {
            releaseBlob(blob);
View Full Code Here

        logVersion = in.readByte();
      } catch (EOFException e) {
        available = false;
      }
      if (available) {
        in.reset();
        logVersion = in.readInt();
        if (logVersion < FSConstants.LAYOUT_VERSION) // future version
          throw new IOException(
                          "Unexpected version of the file system log file: "
                          + logVersion + ". Current version = "
View Full Code Here

        PFBData pfb = new PFBData();
        BufferedInputStream bin = new BufferedInputStream(in);
        DataInputStream din = new DataInputStream(bin);
        din.mark(32);
        int firstByte = din.readUnsignedByte();
        din.reset();
        if (firstByte == 128) {
            pfb.setPFBFormat(PFBData.PFB_PC);
            parsePCFormat(pfb, din);
        } else {
            pfb.setPFBFormat(PFBData.PFB_RAW);
View Full Code Here

            int lastIndex = header.numRecords - 1;

            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

                recArray[i] = new Record(bytes, recAttrs[i]);
            }
    
            // 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

            int lastIndex = header.numRecords - 1;

            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

                recArray[i] = new Record(bytes, recAttrs[i]);
            }
    
            // 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

        // Read it all (less than 32k).  Seeking around (using
        // mark/reset/skipBytes) doesn't work directly on the file,
        // but it works fine if we read everything into a byte[] array
        // first.
        byte raw[] = new byte[total_size];
        d.reset();
        d.readFully(raw);
        d.close();

        Builder builder = new Builder(raw);
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.