Path: blob/master/test/jdk/java/nio/Buffer/OrderInt.java
41149 views
/*1* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/* Type-specific source code for unit test24*25* Regenerate the OrderX classes via genOrder.sh whenever this file changes.26* We check in the generated source files so that the test tree can be used27* independently of the rest of the source tree.28*/2930// -- This file was mechanically generated: Do not edit! -- //3132import java.nio.*;3334public class OrderInt extends Order {35private static void ckIntBuffer(IntBuffer buf, ByteOrder expected) {36ck(buf.asReadOnlyBuffer().order(), expected);37ck(buf.duplicate().order(), expected);38ck(buf.slice().order(), expected);3940414243}4445static void ckIntBuffer() {46int[] array = new int[LENGTH];47IntBuffer buf = IntBuffer.wrap(array);48ck(buf.order(), nord);49ckIntBuffer(buf, nord);5051buf = IntBuffer.wrap(array, LENGTH/2, LENGTH/2);52ck(buf.order(), nord);53ckIntBuffer(buf, nord);5455buf = IntBuffer.allocate(LENGTH);56ck(buf.order(), nord);57ckIntBuffer(buf, nord);58596061626364656667686970717273747576777879}80}81828384