Examples of array()


Examples of java.nio.ByteBuffer.array()

          int message_length = Convert.shortToInt(packet_data
              .getShort());
          ByteBuffer message_bytes = Misc
              .getByteBuffer(message_length);
          packet_data.get(message_bytes.array());
          String message = new String(message_bytes.array());
          message_bytes.clear();
          message_bytes = null;
          _peer_manager.receivedMessage(peerIP, peerPort, message);
          break;
        }
View Full Code Here

Examples of java.nio.ByteBuffer.array()

          long chunkStart = Convert.intToLong(packet_data.getInt());
          long chunkEnd = Convert.intToLong(packet_data.getInt());
          long compressedSize = packet_data.capacity()
              - packet_data.position();
          ByteBuffer data = Misc.getByteBuffer(compressedSize);
          packet_data.get(data.array());

          _network_manager.receivedCompressedFileChunkFromPeer(
              peerIP, peerPort, new FileHash(file_hash),
              new FileChunk(chunkStart, chunkEnd, data));
          break;
View Full Code Here

Examples of java.nio.ByteBuffer.array()

        case OP_CHATCAPTCHAREQ: {
          packet_data.get();

          ByteBuffer image_data = Misc.getByteBuffer(pkLength - 2);
          image_data.position(0);
          packet_data.get(image_data.array());
          image_data.position(0);
          _peer_manager.receivedCaptchaImage(peerIP, peerPort,
              image_data);
          break;
        }
View Full Code Here

Examples of java.nio.ByteBuffer.array()

     
      for(FileChunkRequest request : partsData) {
        num.clear();
        num.rewind();
        num.putInt(Convert.longToInt(request.getChunkEnd()));
        packet.insertData(num.array());
      }
     
      return packet;
  }
 
View Full Code Here

Examples of java.nio.ByteBuffer.array()

      data.put(SEARCH_BY_LIMIT);
      data.putShort(Convert.intToShort(str.length()));
      data.put(str.getBytes());
      data.putShort(Convert.intToShort(TAG_NAME_FORMAT.length));
      data.put(TAG_NAME_FORMAT);
      return data.array();
    }
    return null;
  }

}
View Full Code Here

Examples of java.nio.CharBuffer.array()

  // convert byte array to char array, assuming UTF-8 encoding

  static protected char[] convertByteToCharUTF(byte[] byteArray) {
    Charset c = Charset.forName("UTF-8");
    CharBuffer output = c.decode(ByteBuffer.wrap(byteArray));
    return output.array();
  }

  // convert char array to byte array, assuming UTF-8 encoding
  static protected byte[] convertCharToByteUTF(char[] from) {
    Charset c = Charset.forName("UTF-8");
View Full Code Here

Examples of java.nio.FloatBuffer.array()

    gl.glGetFloatv(GL.GL_PROJECTION_MATRIX, fbproj);

    gl.glGetFloatv(GL.GL_MODELVIEW_MATRIX, fbmodl);

    float proj[] = fbproj.array();
    float modl[] = fbmodl.array();

    // multiply modl*proj to get resulting view matrix

    clip[0] = modl[0] * proj[0] + modl[1] * proj[4] + modl[2] * proj[8]
        + modl[3] * proj[12];
 
View Full Code Here

Examples of java.nio.IntBuffer.array()


      case NCLibrary.NC_INT:
      case NCLibrary.NC_UINT:
        IntBuffer ib = bb.asIntBuffer();
        sArray = Array.factory(DataType.INT, shape, ib.array());
        return (baseType == NCLibrary.NC_INT) ? sArray : MAMath.convertUnsigned(sArray);
    }

    return null;
  }
View Full Code Here

Examples of java.nio.MappedByteBuffer.array()

            byte[] tmpb = null;

            if (bb.hasArray())
            {
               tmpb = bb.array();
            }
            else
            {
               // impossible code in most cases, as we use heap backed buffer
               tmpb = new byte[bb.capacity()];
View Full Code Here

Examples of java.nio.ShortBuffer.array()

        return (baseType == NCLibrary.NC_BYTE) ? sArray : MAMath.convertUnsigned(sArray);

      case NCLibrary.NC_SHORT:
      case NCLibrary.NC_USHORT:
        ShortBuffer sb = bb.asShortBuffer();
        sArray = Array.factory(DataType.SHORT, shape, sb.array());
        return (baseType == NCLibrary.NC_SHORT) ? sArray : MAMath.convertUnsigned(sArray);


      case NCLibrary.NC_INT:
      case NCLibrary.NC_UINT:
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.