Package java.io

Examples of java.io.DataInputStream.readInt()


    }
   
    private void processData() throws  IOException, InterruptedException {
      DataInputStream dis =
        new DataInputStream(new ByteArrayInputStream(data.array()));
      int id = dis.readInt();                    // try to read an id
       
      if (LOG.isDebugEnabled())
        LOG.debug(" got #" + id);
           
      Writable param = (Writable)ReflectionUtils.newInstance(paramClass, conf);           // read param
View Full Code Here


      // reads will not work. So that's why
      // we are reading here and not assigning to any variable.
      if (swap) {
        swap4(dis, bytebuf);
      } else {
        dis.readInt();
      }

      // main fsheap
      int fsheapsz = 0;
      if (swap) {
View Full Code Here

      // main fsheap
      int fsheapsz = 0;
      if (swap) {
        fsheapsz = swap4(dis, bytebuf);
      } else {
        fsheapsz = dis.readInt();
      }

      this.getHeap().reinitSizeOnly(fsheapsz);
      for (int i = 0; i < fsheapsz; i++) {
        if (swap) {
View Full Code Here

      this.getHeap().reinitSizeOnly(fsheapsz);
      for (int i = 0; i < fsheapsz; i++) {
        if (swap) {
          this.getHeap().heap[i] = swap4(dis, bytebuf);
        } else {
          this.getHeap().heap[i] = dis.readInt();
        }
      }

      // string heap
      int stringheapsz = 0;
View Full Code Here

      // string heap
      int stringheapsz = 0;
      if (swap) {
        stringheapsz = swap4(dis, bytebuf);
      } else {
        stringheapsz = dis.readInt();
      }

      this.getStringHeap().stringHeap = new char[stringheapsz];
      for (int i = 0; i < stringheapsz; i++) {
        if (swap) {
View Full Code Here

      // string ref heap
      int refheapsz = 0;
      if (swap) {
        refheapsz = swap4(dis, bytebuf);
      } else {
        refheapsz = dis.readInt();
      }

      refheapsz--;
      refheapsz = refheapsz / 2;
      refheapsz = refheapsz * 3;
 
View Full Code Here

      // read back into references consisting to three ints
      // --stringheap offset,length, stringlist offset
      this.getStringHeap().refHeap = new int[StringHeap.FIRST_CELL_REF + refheapsz];

      dis.readInt(); // 0
      for (int i = this.getStringHeap().refHeapPos; i < this.getStringHeap().refHeap.length; i += StringHeap.REF_HEAP_CELL_SIZE) {
        if (swap) {
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_POINTER_OFFSET] = swap4(dis, bytebuf);
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_STRLEN_OFFSET] = swap4(dis, bytebuf);
        } else {
View Full Code Here

      for (int i = this.getStringHeap().refHeapPos; i < this.getStringHeap().refHeap.length; i += StringHeap.REF_HEAP_CELL_SIZE) {
        if (swap) {
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_POINTER_OFFSET] = swap4(dis, bytebuf);
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_STRLEN_OFFSET] = swap4(dis, bytebuf);
        } else {
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_POINTER_OFFSET] = dis.readInt();
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_STRLEN_OFFSET] = dis.readInt();
        }
        this.getStringHeap().refHeap[i + StringHeap.STRING_LIST_ADDR_OFFSET] = 0;
      }
      this.getStringHeap().refHeapPos = refheapsz+ StringHeap.FIRST_CELL_REF;
View Full Code Here

        if (swap) {
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_POINTER_OFFSET] = swap4(dis, bytebuf);
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_STRLEN_OFFSET] = swap4(dis, bytebuf);
        } else {
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_POINTER_OFFSET] = dis.readInt();
          this.getStringHeap().refHeap[i + StringHeap.CHAR_HEAP_STRLEN_OFFSET] = dis.readInt();
        }
        this.getStringHeap().refHeap[i + StringHeap.STRING_LIST_ADDR_OFFSET] = 0;
      }
      this.getStringHeap().refHeapPos = refheapsz+ StringHeap.FIRST_CELL_REF;
View Full Code Here

      // indexed FSs
      int fsindexsz = 0;
      if (swap) {
        fsindexsz = swap4(dis, bytebuf);
      } else {
        fsindexsz = dis.readInt();
      }
      int[] fsindexes = new int[fsindexsz];
      for (int i = 0; i < fsindexsz; i++) {
        if (swap) {
          fsindexes[i] = swap4(dis, bytebuf);
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.