Package java.nio

Examples of java.nio.ByteBuffer.asIntBuffer()


   
    // A partir de una tecla integer me crea un evento con el string a enviar a nucleo
    // 81--> m0 (arriba)
    public static IntBuffer crearEvento(int tecla){
        ByteBuffer buffer = ByteBuffer.allocate(8);
        IntBuffer intBuffer = buffer.asIntBuffer();
       
        String cod= decodificar(tecla);
        buffer.flip();
        buffer.clear();
       
View Full Code Here


    }
    public static int enviar(int tecla){
       
        ByteBuffer enviar=null;
        ByteBuffer buffer = ByteBuffer.allocate(8);
        IntBuffer intBuffer = buffer.asIntBuffer();
       
        ByteBuffer mensaje = ByteBuffer.allocate(8);
        IntBuffer intBufferMensaje = mensaje.asIntBuffer();
       
        int capturar=0; // no capturo
View Full Code Here

        ByteBuffer enviar=null;
        ByteBuffer buffer = ByteBuffer.allocate(8);
        IntBuffer intBuffer = buffer.asIntBuffer();
       
        ByteBuffer mensaje = ByteBuffer.allocate(8);
        IntBuffer intBufferMensaje = mensaje.asIntBuffer();
       
        int capturar=0; // no capturo
        if (tecla==-1){
            intBuffer.put(0, -1);
            intBuffer.put(1, -1);
View Full Code Here

        return(capturar);
       
    }
    public static void enviarNombreDriver(){
     ByteBuffer buffer2 = ByteBuffer.allocate(8);
     IntBuffer intBuffer2 = buffer2.asIntBuffer();
      
        try {
            intBuffer2.put(0, 8);
            intBuffer2.put(1, 1);
            sc.write(buffer2);
View Full Code Here

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

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

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

  public final static class Monkey{
    final IntBuffer buf;
   
    public Monkey(){
      ByteBuffer bb = ByteBuffer.allocateDirect(Integer.MAX_VALUE);
      buf = bb.asIntBuffer();
    }
   
    public final void set(int index, int value){
      buf.put(index, value);
    }
View Full Code Here

          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

        ur2[k] = (ur2[k] ^ accumulator);
      }
    }

    ByteBuffer byteBuffer = ByteBuffer.allocate(ur2.length * 4);
    byteBuffer.asIntBuffer().put(ur2);
    r2 = byteBuffer.array();

  }

  public static int singleDivide(int a, int b, int w) throws Exception {
View Full Code Here

  private IntBuffer allocSelectBuffer() {
    int pickableCount = countAllPickable();
    int allocBytes = pickableCount * 6 * BYTES_PER_INT;
    ByteBuffer result = ByteBuffer.allocateDirect(allocBytes);
    result.order(ByteOrder.nativeOrder());
    return result.asIntBuffer();
  }

  @Override
  protected IntBuffer getSelectBuffer() {
    return selectBuffer;
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.