Package java.nio

Examples of java.nio.ByteBuffer.array()


     
      data = Misc.getByteBuffer(16);
      for(int i = 0 ; i <partCount; i++){
        data.clear();
        fileChannel.read(data);
        fileHashSet.add(data.array());
      }
     
      //Read tag count
      data = Misc.getByteBuffer(4);
      fileChannel.read(data);
View Full Code Here


      ByteBuffer data = Misc.getByteBuffer(1 + 2 + str_content.length);
      data.position(0);
      data.put(SEARCH_BY_NAME);
      data.putShort(Convert.intToShort(str_content.length));
      data.put(str_content);
      return data.array();
    }
    if (type == FILETYPE) {
      FileType type = (FileType)getValue(Tree.DATA_KEY);
      ByteBuffer data = Misc.getByteBuffer(1 + 2 + type.getBytes().length + 2 + TAG_NAME_FILE_TYPE.length);
      data.position(0);
View Full Code Here

        TagList tagList = new TagList();
        //Read server IP
        data = Misc.getByteBuffer(4);
        fileChannel.read(data);
       
        String remonteAddress = Convert.IPtoString(data.array());
       
        //Read server port
        data = Misc.getByteBuffer(2);
        fileChannel.read(data);
       
View Full Code Here

      data.put(SEARCH_BY_META);
      data.putShort(Convert.intToShort(type.getBytes().length));
      data.put(type.getBytes());
      data.putShort(Convert.intToShort(TAG_NAME_FILE_TYPE.length));
      data.put(TAG_NAME_FILE_TYPE);
      return data.array();
    }
   
    if (type == MINSIZE) {
      ByteBuffer data = Misc.getByteBuffer(1 + 4 + 1 + 2 + TAG_NAME_SIZE.length);
      data.position(0);
View Full Code Here

      long v = (Long)getValue(Tree.DATA_KEY);
      data.putInt(Convert.longToInt(v));
      data.put(LIMIT_MIN);
      data.putShort(Convert.intToShort(TAG_NAME_SIZE.length));
      data.put(TAG_NAME_SIZE);
      return data.array();
    }
   
    if (type == MAXSIZE) {
      ByteBuffer data = Misc.getByteBuffer(1 + 4 + 1 + 2 + TAG_NAME_SIZE.length);
      data.position(0);
View Full Code Here

      long v = (Long)getValue(Tree.DATA_KEY);
      data.putInt(Convert.longToInt(v));
      data.put(LIMIT_MAX);
      data.putShort(Convert.intToShort(TAG_NAME_SIZE.length));
      data.put(TAG_NAME_SIZE);
      return data.array();
    }
   
    if (type == MINAVAILABILITY) {
      ByteBuffer data = Misc.getByteBuffer(1 + 4 + 1 + 2 + TAG_NAME_AVIABILITY.length);
      data.position(0);
View Full Code Here

      long v = (Long)getValue(Tree.DATA_KEY);
      data.putInt(Convert.longToInt(v));
      data.put(LIMIT_MIN);
      data.putShort(Convert.intToShort(TAG_NAME_AVIABILITY.length));
      data.put(TAG_NAME_AVIABILITY);
      return data.array();
    }
    if (type == MAXAVAILABILITY) {
      ByteBuffer data = Misc.getByteBuffer(1 + 4 + 1 + 2 + TAG_NAME_AVIABILITY.length);
      data.position(0);
      data.put(SEARCH_BY_LIMIT);
View Full Code Here

      long v = (Long)getValue(Tree.DATA_KEY);
      data.putInt(Convert.longToInt(v));
      data.put(LIMIT_MAX);
      data.putShort(Convert.intToShort(TAG_NAME_AVIABILITY.length));
      data.put(TAG_NAME_AVIABILITY);
      return data.array();
    }
    if (type == MINCOMPLETESRC) {
      ByteBuffer data = Misc.getByteBuffer(1 + 4 + 1 + 2 + TAG_NAME_COMPLETESRC.length);
      data.position(0);
      data.put(SEARCH_BY_LIMIT);
View Full Code Here

      long v = (Long)getValue(Tree.DATA_KEY);
      data.putInt(Convert.longToInt(v));
      data.put(LIMIT_MIN);
      data.putShort(Convert.intToShort(TAG_NAME_COMPLETESRC.length));
      data.put(TAG_NAME_COMPLETESRC);
      return data.array();
    }
    if (type == MAXCOMPLETESRC) {
      ByteBuffer data = Misc.getByteBuffer(1 + 4 + 1 + 2 + TAG_NAME_COMPLETESRC.length);
      data.position(0);
      data.put(SEARCH_BY_LIMIT);
View Full Code Here

      long v = (Long)getValue(Tree.DATA_KEY);
      data.putInt(Convert.longToInt(v));
      data.put(LIMIT_MAX);
      data.putShort(Convert.intToShort(TAG_NAME_COMPLETESRC.length));
      data.put(TAG_NAME_COMPLETESRC);
      return data.array();
    }
    if (type == EXTENSION) {
      String str = (String)getValue(Tree.DATA_KEY);
      ByteBuffer data = Misc.getByteBuffer(1 + 2 + str.length() + 2 + TAG_NAME_FORMAT.length);
      data.position(0);
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.