Package java.io

Examples of java.io.DataInputStream.skip()


    
            // 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


     
//      if (this.received_fms_packet == false)
//        logger.fine("... FMSE packet contains " + nb_of_entries + " FMS entries");
     
      int active_entry_index = (int) data_stream.readFloat();
      data_stream.skip(4);    // don't evaluate destination entry index. This info is determined by is_active flag"
     
      for (int i=0;i<nb_of_entries;i++) {
        int type = (int) data_stream.readFloat();
        String id = new String(sim_data,((i*24))+20,5).trim()
        data_stream.skipBytes(8);
 
View Full Code Here

                        new Partition<I, V, E, M>(
                            getConfiguration(),
                            partitionId);
                    DataInputStream partitionsStream =
                        getFs().open(new Path(partitionsFile));
                    if (partitionsStream.skip(startPos) != startPos) {
                        throw new IllegalStateException(
                            "loadCheckpoint: Failed to skip " + startPos +
                            " on " + partitionsFile);
                    }
                    partition.readFields(partitionsStream);
View Full Code Here

          metadataStream.close();
          Partition<I, V, E, M> partition =
              getConfiguration().createPartition(partitionId, getContext());
          DataInputStream partitionsStream =
              getFs().open(new Path(partitionsFile));
          if (partitionsStream.skip(startPos) != startPos) {
            throw new IllegalStateException(
                "loadCheckpoint: Failed to skip " + startPos +
                " on " + partitionsFile);
          }
          partition.readFields(partitionsStream);
View Full Code Here

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

        fromAddr.setNode(FtnTools.revShort(is.readShort()));
        toAddr.setNode(FtnTools.revShort(is.readShort()));
        fromAddr.setNet(FtnTools.revShort(is.readShort()));
        toAddr.setNet(FtnTools.revShort(is.readShort()));
        attribute = FtnTools.revShort(is.readShort());
        is.skip(2);
        date = FORMAT.parse(FtnTools.readUntillNull(is));
        toName = FtnTools.readUntillNull(is);
        fromName = FtnTools.readUntillNull(is);
        subject = FtnTools.readUntillNull(is);
        String lines[] = FtnTools.readUntillNull(is)
View Full Code Here

        this.date = calendar.getTime();
      } catch (Exception e) {
        this.date = new Date(0);
      }
    }
    is.skip(4);
    fromAddr.setNet(FtnTools.revShort(is.readShort()));
    toAddr.setNet(FtnTools.revShort(is.readShort()));
    is.skip(2);
    {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
View Full Code Here

      }
    }
    is.skip(4);
    fromAddr.setNet(FtnTools.revShort(is.readShort()));
    toAddr.setNet(FtnTools.revShort(is.readShort()));
    is.skip(2);
    {
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      for (int i = 0; i < 8; i++) {
        int c = is.read();
        if (c != 0) {
View Full Code Here

        }
      }
      bos.close();
      password = new String(bos.toByteArray());
    }
    is.skip(12);
    fromAddr.setZone(FtnTools.revShort(is.readShort()));
    toAddr.setZone(FtnTools.revShort(is.readShort()));
    fromAddr.setPoint(FtnTools.revShort(is.readShort()));
    toAddr.setPoint(FtnTools.revShort(is.readShort()));
    is.skip(4);
View Full Code Here

    is.skip(12);
    fromAddr.setZone(FtnTools.revShort(is.readShort()));
    toAddr.setZone(FtnTools.revShort(is.readShort()));
    fromAddr.setPoint(FtnTools.revShort(is.readShort()));
    toAddr.setPoint(FtnTools.revShort(is.readShort()));
    is.skip(4);
  }

  public FtnMessage getNextMessage() {
    try {
      FtnMessage mess = new FtnMessage();
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.