Package java.nio

Examples of java.nio.ByteBuffer.asLongBuffer()


            out.println("\ncalling f581bb1(f481bb1())");
            final ByteBuffer f481bb = MyJapi.f481bb1().order(ByteOrder.nativeOrder());
            final long nf481bb = f481bb.asLongBuffer().get();
            MyJapi.f581bb1(f481bb);
            assert (nf481bb + 1 == f481bb.asLongBuffer().get());

            out.println("\ncalling f582bb1(f482bb1())");
            final ByteBuffer f482bb = MyJapi.f482bb1().order(ByteOrder.nativeOrder());
            final long nf482bb = f482bb.asLongBuffer().get();
            MyJapi.f582bb1(f482bb);
View Full Code Here


            MyJapi.f581bb1(f481bb);
            assert (nf481bb + 1 == f481bb.asLongBuffer().get());

            out.println("\ncalling f582bb1(f482bb1())");
            final ByteBuffer f482bb = MyJapi.f482bb1().order(ByteOrder.nativeOrder());
            final long nf482bb = f482bb.asLongBuffer().get();
            MyJapi.f582bb1(f482bb);
            assert (nf482bb + 1 == f482bb.asLongBuffer().get());

            out.println("\ncalling f583bb1(f483bb1())");
            final ByteBuffer f483bb = MyJapi.f483bb1().order(ByteOrder.nativeOrder());
View Full Code Here

            out.println("\ncalling f582bb1(f482bb1())");
            final ByteBuffer f482bb = MyJapi.f482bb1().order(ByteOrder.nativeOrder());
            final long nf482bb = f482bb.asLongBuffer().get();
            MyJapi.f582bb1(f482bb);
            assert (nf482bb + 1 == f482bb.asLongBuffer().get());

            out.println("\ncalling f583bb1(f483bb1())");
            final ByteBuffer f483bb = MyJapi.f483bb1().order(ByteOrder.nativeOrder());
            final float nf483bb = f483bb.asFloatBuffer().get();
            MyJapi.f583bb1(f483bb);
View Full Code Here

    */
   public long readLong() throws IOException
   {
      ByteBuffer dst = ByteBuffer.allocate(8);
      readFully(dst);
      return dst.asLongBuffer().get();
   }

   /**
    * {@inheritDoc}
    */
 
View Full Code Here

          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_LONG_ARRAY)) {
          arrayStart = this.heap.heap[getArrayStartAddress(fs.getAddress())];
          buf = ByteBuffer.allocate(arraySize * 8);
          LongBuffer longbuf = buf.asLongBuffer();
          longbuf.put(this.longHeap.heap, arrayStart, arraySize);
          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_DOUBLE_ARRAY)) {
          arrayStart = this.heap.heap[getArrayStartAddress(fs.getAddress())];
View Full Code Here

        _max = iin.get();
        iin.get(_counts);
        in.position(iin.position() * INT_SIZE);

        // read our long data
        LongBuffer lin = in.asLongBuffer();
        _snapTotal = (_total = lin.get());
        in.position(iin.position() * INT_SIZE + lin.position() * 2 * INT_SIZE);

        // read our min value (which was added afterwards and must do some jockeying to maintain
        // backwards compatibility)
View Full Code Here

        iout.put(_max);
        iout.put(_counts);
        out.position(iout.position() * INT_SIZE);

        // write our long data
        LongBuffer lout = out.asLongBuffer();
        lout.put(_total);
        out.position(iout.position() * INT_SIZE + lout.position() * 2 * INT_SIZE);

        // write our min value (added later so we can't write it above like we wish we could)
        out.asIntBuffer().put(_min);
View Full Code Here

      // ByteBuffer buf = ByteBuffer.wrap(b);
      // buf.putLong(l);
      // return b;

      ByteBuffer buf = ByteBuffer.wrap(b);
      LongBuffer lBuffer = buf.asLongBuffer();
      lBuffer.put(0, l);
      return b;
    }

    // Alternate byte conversion
View Full Code Here

   
    FloatBuffer fBuffer = buffer.asFloatBuffer();
    fBuffer.position(1);
    System.out.println(Memory.getPosition(fBuffer));
   
    LongBuffer lBuffer = buffer.asLongBuffer();
    lBuffer.position(1);
    System.out.println(Memory.getPosition(lBuffer));
   
    DoubleBuffer dBuffer = buffer.asDoubleBuffer();
    dBuffer.position(1);
View Full Code Here

          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_LONG_ARRAY)) {
          arrayStart = this.getHeap().heap[getArrayStartAddress(fs.getAddress())];
          buf = ByteBuffer.allocate(arraySize * 8);
          LongBuffer longbuf = buf.asLongBuffer();
          longbuf.put(this.getLongHeap().heap, arrayStart, arraySize);
          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_DOUBLE_ARRAY)) {
          arrayStart = this.getHeap().heap[getArrayStartAddress(fs.getAddress())];
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.