Creates a floatbuffer of the given size. : Buffer « File « Android

Home
Android
1.2D Graphics
2.Animation
3.Core Class
4.Database
5.Date Type
6.Development
7.File
8.Game
9.Hardware
10.Media
11.Network
12.Security
13.UI
14.User Event
Android » File » Buffer 
Creates a floatbuffer of the given size.
 

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

import android.content.res.Resources;

 class MemUtil {
    
    /**
     * creates a floatbuffer of the given size.
     @param size
     @return
     */
    public static FloatBuffer makeFloatBuffer(int size) {
      ByteBuffer bb = ByteBuffer.allocateDirect(size*4);
      bb.order(ByteOrder.nativeOrder());
      FloatBuffer fb = bb.asFloatBuffer();
      fb.position(0);
      return fb;
    }

}

   
  
Related examples in the same category
1.Fast Float Buffer
2.Demonstrate the Frame Buffer Object OpenGL ES extension.
3.Loads a file to a ByteBuffer.
4.Make a direct NIO FloatBuffer from an array of floats
5.Make a direct NIO ByteBuffer from an array of bytes
6.Make Float Buffer From Array
7.Make Float Buffer with ByteBuffer.allocateDirect
8.allocate Float Buffer
9.to Short Buffer
10.to Float Buffer Position Zero
11.allocate Short Buffer
12.allocate Int Buffer
13.Read InputStream with BufferedReader
14.To convert the InputStream to String we use the BufferedReader.readLine() method.
15.make Float Buffer
16.get Buffer From Array
17.Your own float buffer
18.Direct Buffer
19.create Buffer
20.Write String to File with BufferWriter
21.Byte Buffer Stack
22.Compute the SHA-1 hash of the bytes in the given buffer
23.An utility class for java.nio.Buffers
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.