Examples of order()


Examples of java.nio.ByteBuffer.order()

            fis.read(bb.array());
            IntBuffer ib = bb.asIntBuffer();
            boolean swap = (ib.get(2) < 0 || ib.get(2) > MAX_NUM_CLASS_PRUNERS);
            if (swap) {
                bo = ByteOrder.LITTLE_ENDIAN;
                bb.order(bo);
                ib = bb.asIntBuffer();
            }
            int unicharset_size = ib.get(0);
            int NumClasses = ib.get(1);
            int NumClassPruners = ib.get(2);

Examples of java.nio.ByteBuffer.order()

  public static long gzipUncompressedCRC32(File src) throws IOException {
    FileChannel in = new RandomAccessFile(src, "r").getChannel();

    ByteBuffer b = ByteBuffer.allocate(128);
    b.order(ByteOrder.LITTLE_ENDIAN);

    in.read(b, in.size() - b.remaining());

    final long size = b.getInt(b.limit() - 8);

Examples of java.nio.ByteBuffer.order()

   */
  public static ByteBuffer slice(ByteBuffer buffer) {

    final ByteOrder o = buffer.order();
    final ByteBuffer r = buffer.slice();
    r.order(o);

    return r;
  }

  /**
 

Examples of java.nio.ByteBuffer.order()

   */
  public static ByteBuffer asReadonly(ByteBuffer buffer) {

    final ByteOrder o = buffer.order();
    final ByteBuffer r = buffer.asReadOnlyBuffer();
    r.order(o);

    return r;
  }

  public static ByteBuffer copy(ByteBuffer buffer) {

Examples of java.nio.ByteBuffer.order()

  public static ByteBuffer copy(ByteBuffer buffer) {

    final int length = buffer.limit() - buffer.position();
    final ByteOrder o = buffer.order();
    final ByteBuffer r = ByteBuffer.allocate(length);
    r.order(o);

    r.put(buffer);
    r.clear(); // Reset position and limit after the put()

    return r;

Examples of java.nio.ByteBuffer.order()

   * @param buffer
   * @return
   */
  public static ByteBuffer duplicate(ByteBuffer buffer) {
    final ByteBuffer r = buffer.duplicate();
    r.order(buffer.order());

    return r;
  }
}

Examples of java.nio.ByteBuffer.order()

  public static ByteBuffer createBuffer(final int length) {

    final ByteBuffer data = ByteBuffer.allocate(SnoopPacketRecord.HEADER_LENGTH
        + length);
    data.order(ByteOrder.BIG_ENDIAN);
    final int included = length;
    final int original = included;
    final int record = included + SnoopPacketRecord.HEADER_LENGTH;
    final int drops = 0;
    final long millis = System.currentTimeMillis();

Examples of java.nio.CharBuffer.order()

    assertNotSame(buf, readonly);
    assertTrue(readonly.isReadOnly());
    assertEquals(buf.position(), readonly.position());
    assertEquals(buf.limit(), readonly.limit());
    assertEquals(buf.isDirect(), readonly.isDirect());
    assertEquals(buf.order(), readonly.order());
    assertEquals(buf.capacity(), readonly.capacity());
    assertContentEquals(buf, readonly);

    // readonly's position, mark, and limit should be independent to buf
    readonly.reset();

Examples of java.nio.DoubleBuffer.order()

        assertNotSame(buf, readonly);
        assertTrue(readonly.isReadOnly());
        assertEquals(buf.position(), readonly.position());
        assertEquals(buf.limit(), readonly.limit());
        assertEquals(buf.isDirect(), readonly.isDirect());
        assertEquals(buf.order(), readonly.order());
        assertContentEquals(buf, readonly);

        // readonly's position, mark, and limit should be independent to buf
        readonly.reset();
        assertEquals(readonly.position(), 0);

Examples of java.nio.FloatBuffer.order()

        assertNotSame(buf, readonly);
        assertTrue(readonly.isReadOnly());
        assertEquals(buf.position(), readonly.position());
        assertEquals(buf.limit(), readonly.limit());
        assertEquals(buf.isDirect(), readonly.isDirect());
        assertEquals(buf.order(), readonly.order());
        assertContentEquals(buf, readonly);

        // readonly's position, mark, and limit should be independent to buf
        readonly.reset();
        assertEquals(readonly.position(), 0);
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.