Package java.nio

Examples of java.nio.ByteBuffer.array()


            break;
          }
       
          it.remove();
       
          byte[]  data = buffer.array();
         
          if ( buffer == initial_buffer ){
           
            this_is_oop = false;
          }
View Full Code Here


    buffer.put((byte)0);
   
    //interlace method : 1 byte
    buffer.put((byte)0);
   
    return buffer.array();
   
  }

}
View Full Code Here

          // pass directly to buffer data
          AL10.alBufferData(buffers.get(0), AL10.AL_FORMAT_VORBIS_EXT, filebuffer, -1);
          filebuffer.clear();
        } else {
          // load wave data from buffer
          WaveData wavefile = WaveData.create(filebuffer.array());

          //copy to buffers
          AL10.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.samplerate);
       
          //unload file again
View Full Code Here

       
      case TAGTYPE_BSOB :
        byte size = data.get();
        ByteBuffer raw_data = getByteBuffer(size+1);
        raw_data.put(size);
        data.get(raw_data.array(), 1, size);
        return new BSOBTag(tagName, raw_data);
       
      case TAGTYPE_FLOAT32 :
        float value = data.getFloat();
        return new FloatTag(tagName, value);
View Full Code Here

   
    tagNameLength = Convert.shortToInt(data.getShort(0));

    data = getByteBuffer(tagNameLength);
    file.read(data);
    tagName = data.array();
   
    switch(tagType) {
      case TAGTYPE_HASH :
        data = getByteBuffer(16);
        file.read(data);
View Full Code Here

   
    switch(tagType) {
      case TAGTYPE_HASH :
        data = getByteBuffer(16);
        file.read(data);
        byte[] hash = data.array();
        FileHash tag_hash_data = new FileHash(hash);
        return new HashTag(tagName, tag_hash_data);

      case TAGTYPE_STRING :
        data =  getByteBuffer(2);
View Full Code Here

        data =  getByteBuffer(2);
        file.read(data);
        int str_length = Convert.shortToInt(data.getShort(0));
        data =  getByteBuffer(str_length);
        file.read(data);
        String str = new String(data.array());
        return new StringTag(tagName, str);
     
      case TAGTYPE_UINT8 :
        data =  getByteBuffer(1);
        file.read(data);
View Full Code Here

        ByteBuffer tboolArraySize = Misc.getByteBuffer(2);
        file.read(tboolArraySize);
        short boolArraySize = tboolArraySize.getShort(0);
        ByteBuffer boolArray = Misc.getByteBuffer((boolArraySize+7)/8);
        file.read(boolArray);
        return new BoolArrayTag(tagName, boolArray.array());
      case TAGTYPE_BLOB :
        ByteBuffer tblobSize = Misc.getByteBuffer(4);
        file.read(tblobSize);
        int blobSize = tblobSize.getInt(0);
        ByteBuffer blobData = Misc.getByteBuffer(blobSize);
View Full Code Here

        ByteBuffer tblobSize = Misc.getByteBuffer(4);
        file.read(tblobSize);
        int blobSize = tblobSize.getInt(0);
        ByteBuffer blobData = Misc.getByteBuffer(blobSize);
        file.read(blobData);
        return new BlobTag(tagName, blobData.array());
    }
    System.out.println("Unknown tag opcode : " + Convert.byteToHex(tagType));
    return null;
  }
}
View Full Code Here

   
      known_met_entity.setDate(Date);
   
      data = Misc.getByteBuffer(16);
      fileChannel.read(data);
      FileHash fileHash = new FileHash(data.array());
   
      data = Misc.getByteBuffer(2);
      fileChannel.read(data);
      int partCount = data.getShort(0);
      PartHashSet partHash = new PartHashSet(fileHash);
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.