Examples of asIntBuffer()


Examples of java.nio.ByteBuffer.asIntBuffer()

          ByteArrayInputStream bis = new ByteArrayInputStream( sb.toString().getBytes("UTF-8") );
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_INTEGER_ARRAY)) {
          arrayStart = getArrayStartAddress(fs.getAddress());
          buf = ByteBuffer.allocate(arraySize * 4);
          IntBuffer intbuf = buf.asIntBuffer();
          intbuf.put(this.getHeap().heap, arrayStart, arraySize);
          ByteArrayInputStream bis = new ByteArrayInputStream(buf.array());
          return bis;
        } else if (type.getName().equals(CAS.TYPE_NAME_FLOAT_ARRAY)) {
          arrayStart = getArrayStartAddress(fs.getAddress());
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    uima[1] = 73; // I
    uima[2] = 77; // M
    uima[3] = 65; // A

    ByteBuffer buf = ByteBuffer.wrap(uima);
    int key = buf.asIntBuffer().get();

    dos.writeInt(key);
    dos.writeInt(version);
  }
 
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

      int yspot = imageData.getHeight() - y - 1;
      if (yspot < 0) {
        yspot = 0;
      }
     
      return new Cursor(imageData.getTexWidth(), imageData.getTexHeight(), x, yspot, 1, buf.asIntBuffer(), null);
    } catch (Throwable e) {
      Log.info("Chances are you cursor is too small for this platform");
      throw new LWJGLException(e);
    }
  }
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    try {
      int yspot = imageData.getHeight() - y - 1;
      if (yspot < 0) {
        yspot = 0;
      }
      return new Cursor(imageData.getTexWidth(), imageData.getTexHeight(), x, yspot, 1, buf.asIntBuffer(), null);
    } catch (Throwable e) {
      Log.info("Chances are you cursor is too small for this platform");
      throw new LWJGLException(e);
    }
  }
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    cursorDelaysBuffer.flip();

    LoadableImageData imageData = new TGAImageData();
    ByteBuffer buf = imageData.loadImage(ResourceLoader.getResourceAsStream(ref), false, null);
         
    return new Cursor(width, height, x, y, cursorDelays.length, buf.asIntBuffer(), cursorDelaysBuffer);
  }
}
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

     */
    public static IntBuffer createIntBuffer(int size) {
      ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
      temp.order(ByteOrder.nativeOrder());

      return temp.asIntBuffer();
    }   
}
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

     */
    protected IntBuffer createIntBuffer(int size) {
      ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
      temp.order(ByteOrder.nativeOrder());

      return temp.asIntBuffer();
    }   
   
    /**
   * @see org.newdawn.slick.opengl.Texture#getTextureData()
   */
 
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    if ( MemoryUtil.getAddress(buffer) % PAGE_SIZE != 0 ) {
      // Round up to page boundary
      buffer.position(PAGE_SIZE - (int)(MemoryUtil.getAddress(buffer) & (PAGE_SIZE - 1)));
    }

    return buffer.asIntBuffer();
  }

  private static long doTest(final int threads, final int repeats, final int padding, final IntBuffer memory, final ExecutorCompletionService<Long> completionService) {
    for ( int i = 0; i < threads; i++ )
      submitTest(completionService, i, repeats, memory, padding);
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

      // create command queue and upload color map buffer on each used device
      queues[i] = clCreateCommandQueue(clContext, devices.get(i), CL_QUEUE_PROFILING_ENABLE, null);
      queues[i].checkValid();

      final ByteBuffer colorMapBuffer = clEnqueueMapBuffer(queues[i], colorMap[i], CL_TRUE, CL_MAP_WRITE, 0, COLOR_MAP_SIZE, null, null, null);
      initColorMap(colorMapBuffer.asIntBuffer(), 32, Color.BLUE, Color.GREEN, Color.RED);
      clEnqueueUnmapMemObject(queues[i], colorMap[i], colorMapBuffer, null, null);
    }

    // check if we have 64bit FP support on all devices
    // if yes we can use only one program for all devices + one kernel per device.
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    }

    new_mapped_buffer = glMapBufferOES(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY_OES, mapped_indices_buffer);
    if ( new_mapped_buffer != mapped_indices_buffer ) {
      mapped_indices_buffer = new_mapped_buffer;
      mapped_indices_int_buffer = new_mapped_buffer.asIntBuffer();
    }

    mapped_float_buffer.rewind();
    vertices.rewind();
    mapped_float_buffer.put(vertices);
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.