Package java.nio

Examples of java.nio.ByteOrder


    }

    public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ByteBuffer pixels, TextureFX textureFX) {
        GL11.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
        if (textureFX.tileImage == 0) {
            ByteOrder saveOrder = pixels.order();
            pixels.order(ByteOrder.BIG_ENDIAN);
            update("/terrain.png", xoffset, yoffset, width, height, pixels);
            pixels.order(saveOrder);
        }
    }
View Full Code Here


                    break;
                case TYPE_INT_ARRAY:
                    data = new int[length];
                    break;
                case TYPE_BYTE_BUFFER:
                    ByteOrder order =  ByteOrder.nativeOrder();
                    data = ByteBuffer.allocateDirect(length).order(order);
                    break;
                case TYPE_INT_BUFFER:
                default:
                    throw new AssertionError();
View Full Code Here

                ByteBuffer srcBuffer, dstBuffer;

                srcBuffer = getAsByteBuffer();
                srcBuffer.rewind();

                ByteOrder order =  ByteOrder.nativeOrder();
                dstBuffer = ByteBuffer.allocateDirect(length).order(order);
                dstBuffer.rewind();

                // Do copy and swap.
                for(i = 0; i < length; i +=4) {
View Full Code Here

     * platform.
     */
    public void setBuffer(Buffer buffer) {
  Type bType = Type.NULL;
  boolean direct = false;
  ByteOrder order = ByteOrder.BIG_ENDIAN;

  if (buffer == null) {
      bType = Type.NULL;
  }
  else if (buffer instanceof ByteBuffer) {
View Full Code Here

    public static void main(String[] args) throws Exception {

        final boolean isTest = args[2].equals("test");

        int sampleRate = 8000;
        ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;

        AudioFormat format = new AudioFormat(
            AudioFormat.Encoding.PCM_SIGNED,
            sampleRate,
            16,
            1,
            2,
            sampleRate,
            byteOrder.equals(ByteOrder.BIG_ENDIAN));
System.err.println(format);

        InputStream is = new VoxInputStream(new FileInputStream(args[0]), ByteOrder.LITTLE_ENDIAN);
OutputStream os = null;
if (args[1] != null) {
View Full Code Here

    public static void main(String[] args) throws Exception {

        final boolean isTest = args[2].equals("test");

        int sampleRate = 8000;
        ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;

        AudioFormat format = new AudioFormat(
            AudioFormat.Encoding.PCM_SIGNED,
            sampleRate,
            16,
            1,
            2,
            sampleRate,
            byteOrder.equals(ByteOrder.BIG_ENDIAN));
System.err.println(format);

        InputStream is = new Ym2608InputStream(new FileInputStream(args[0]), ByteOrder.LITTLE_ENDIAN);
OutputStream os = null;
if (args[1] != null) {
View Full Code Here

    /** */
    public static void main(String[] args) throws Exception {

        int sampleRate = 8000;
        ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;

        AudioFormat audioFormat = new AudioFormat(
            AudioFormat.Encoding.PCM_SIGNED,
            sampleRate,
            16,
            1,
            2,
            sampleRate,
            byteOrder.equals(ByteOrder.BIG_ENDIAN));
System.err.println(audioFormat);

        InputStream is = new VoxInputStream(new FileInputStream(args[0]),
                                            byteOrder);
System.err.println("available: " + is.available());
View Full Code Here

  }

  @Test
  public void testSanity() throws Exception
  {
    final ByteOrder order = ByteOrder.nativeOrder();
    final int sizePer = 999;
    CompressedFloatsSupplierSerializer serializer = new CompressedFloatsSupplierSerializer(
        sizePer,
        new GenericIndexedWriter<ResourceHolder<FloatBuffer>>(
            new IOPeonForTesting(),
View Full Code Here

  }

  @Test
  public void testSanity() throws Exception
  {
    final ByteOrder order = ByteOrder.nativeOrder();
    final int sizePer = 999;
    CompressedLongsSupplierSerializer serializer = new CompressedLongsSupplierSerializer(
        sizePer,
        new GenericIndexedWriter<ResourceHolder<LongBuffer>>(
            new IOPeonForTesting(),
View Full Code Here

        if (newCapacity > capacity()) {
            // Expand:
            //// Save the state.
            int pos = position();
            int limit = limit();
            ByteOrder bo = order();

            //// Reallocate.
            ByteBuffer oldBuf = buf();
            ByteBuffer newBuf =
                allocator.allocateNioBuffer(newCapacity, isDirect());
View Full Code Here

TOP

Related Classes of java.nio.ByteOrder

Copyright © 2018 www.massapicom. 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.