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

        data.mark(b.length);
        data.readFully(b);
        if (b[0] == 'C' && b[1] == 'W' && b[2] == 'S' ||
                    b[0] == 'F' && b[1] == 'W' && b[2] == 'S')
        {
          data.reset();
          return true;
        }
        else
        {
          data.reset();
View Full Code Here

          data.reset();
          return true;
        }
        else
        {
          data.reset();
          return false;
        }
      }
      catch (IOException e)
      {
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

            try {
                in.mark(4 + 1);

                DataInputStream din = new DataInputStream(in);
                int magic = EndianUtils.swapInteger(din.readInt());
                din.reset();
                if (magic != WMFConstants.META_ALDUS_APM) {
                    return null; //Not a WMF file
                }

                WMFRecordStore wmfStore = new WMFRecordStore();
View Full Code Here

          header.width = ((data[3] & 0xff) << 8) | (data[4] & 0xff);
          header.bitDepth = data[0] & 0xff;
          break;
        }
      }
      dis.reset();
      MetadataReader reader = new MetadataReader(dis);
      Metadata metadata = reader.extract();
      Iterator directories = metadata.getDirectoryIterator();
      while (directories.hasNext()) {
        Directory directory = (Directory)directories.next();
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

        logVersion = in.readByte();
      } catch (EOFException e) {
        available = false;
      }
      if (available) {
        in.reset();
        if (logVersion >= 0)
          logVersion = 0;
        else
          logVersion = in.readInt();
        if (logVersion < FSConstants.LAYOUT_VERSION) // future version
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.