# Uses of Class
java.nio.ByteOrder

Packages that use ByteOrder
Package
Description
java.lang.invoke
The `java.lang.invoke` package provides low-level primitives for interacting with the Java Virtual Machine.
java.nio
Defines buffers, which are containers for data, and provides an overview of the other NIO packages.
javax.imageio.stream
A package of the Java Image I/O API dealing with low-level I/O from files and streams.
jdk.incubator.foreign
Classes to support low-level and efficient foreign memory/function access, directly from Java.
jdk.incubator.vector
Incubating Feature. Will be removed in a future release.

## Uses of ByteOrder in java.lang.invoke

Methods in java.lang.invoke with parameters of type ByteOrder
Modifier and Type
Method
Description
`static VarHandle`
MethodHandles.`byteArrayViewVarHandle(Class<?> viewArrayClass, ByteOrder byteOrder)`
Produces a VarHandle giving access to elements of a `byte[]` array viewed as if it were a different primitive array type, such as `int[]` or `long[]`.
`static VarHandle`
MethodHandles.`byteBufferViewVarHandle(Class<?> viewArrayClass, ByteOrder byteOrder)`
Produces a VarHandle giving access to elements of a `ByteBuffer` viewed as if it were an array of elements of a different primitive component type to that of `byte`, such as `int[]` or `long[]`.

## Uses of ByteOrder in java.nio

Fields in java.nio declared as ByteOrder
Modifier and Type
Field
Description
`static final ByteOrder`
ByteOrder.`BIG_ENDIAN`
Constant denoting big-endian byte order.
`static final ByteOrder`
ByteOrder.`LITTLE_ENDIAN`
Constant denoting little-endian byte order.
Methods in java.nio that return ByteOrder
Modifier and Type
Method
Description
`static ByteOrder`
ByteOrder.`nativeOrder()`
Retrieves the native byte order of the underlying platform.
`final ByteOrder`
ByteBuffer.`order()`
Retrieves this buffer's byte order.
`abstract ByteOrder`
CharBuffer.`order()`
Retrieves this buffer's byte order.
`abstract ByteOrder`
DoubleBuffer.`order()`
Retrieves this buffer's byte order.
`abstract ByteOrder`
FloatBuffer.`order()`
Retrieves this buffer's byte order.
`abstract ByteOrder`
IntBuffer.`order()`
Retrieves this buffer's byte order.
`abstract ByteOrder`
LongBuffer.`order()`
Retrieves this buffer's byte order.
`abstract ByteOrder`
ShortBuffer.`order()`
Retrieves this buffer's byte order.
Methods in java.nio with parameters of type ByteOrder
Modifier and Type
Method
Description
`final ByteBuffer`
ByteBuffer.`order(ByteOrder bo)`
Modifies this buffer's byte order.

## Uses of ByteOrder in javax.imageio.stream

Fields in javax.imageio.stream declared as ByteOrder
Modifier and Type
Field
Description
`protected ByteOrder`
ImageInputStreamImpl.`byteOrder`
The byte order of the stream as an instance of the enumeration class `java.nio.ByteOrder`, where `ByteOrder.BIG_ENDIAN` indicates network byte order and `ByteOrder.LITTLE_ENDIAN` indicates the reverse order.
Methods in javax.imageio.stream that return ByteOrder
Modifier and Type
Method
Description
`ByteOrder`
ImageInputStream.`getByteOrder()`
Returns the byte order with which data values will be read from this stream as an instance of the `java.nio.ByteOrder` enumeration.
`ByteOrder`
ImageInputStreamImpl.`getByteOrder()`
Methods in javax.imageio.stream with parameters of type ByteOrder
Modifier and Type
Method
Description
`void`
ImageInputStream.`setByteOrder(ByteOrder byteOrder)`
Sets the desired byte order for future reads of data values from this stream.
`void`
ImageInputStreamImpl.`setByteOrder(ByteOrder byteOrder)`

## Uses of ByteOrder in jdk.incubator.foreign

Methods in jdk.incubator.foreign that return ByteOrder
Modifier and Type
Method
Description
`ByteOrder`
ValueLayout.`order()`
Returns the value's byte order.
Methods in jdk.incubator.foreign with parameters of type ByteOrder
Modifier and Type
Method
Description
`static char`
MemoryAccess.`getChar(MemorySegment segment, ByteOrder order)`
Reads a char from given segment, with given byte order.
`static char`
MemoryAccess.`getCharAtIndex(MemorySegment segment, long index, ByteOrder order)`
Reads a char from given segment and element index, with given byte order.
`static char`
MemoryAccess.`getCharAtOffset(MemorySegment segment, long offset, ByteOrder order)`
Reads a char from given segment and offset with given byte order.
`static double`
MemoryAccess.`getDouble(MemorySegment segment, ByteOrder order)`
Reads a double from given segment, with given byte order.
`static double`
MemoryAccess.`getDoubleAtIndex(MemorySegment segment, long index, ByteOrder order)`
Reads a double from given segment and element index, with given byte order.
`static double`
MemoryAccess.`getDoubleAtOffset(MemorySegment segment, long offset, ByteOrder order)`
Reads a double from given segment and offset with given byte order.
`static float`
MemoryAccess.`getFloat(MemorySegment segment, ByteOrder order)`
Reads a float from given segment, with given byte order.
`static float`
MemoryAccess.`getFloatAtIndex(MemorySegment segment, long index, ByteOrder order)`
Reads a float from given segment and element index, with given byte order.
`static float`
MemoryAccess.`getFloatAtOffset(MemorySegment segment, long offset, ByteOrder order)`
Reads a float from given segment and offset with given byte order.
`static int`
MemoryAccess.`getInt(MemorySegment segment, ByteOrder order)`
Reads an int from given segment, with given byte order.
`static int`
MemoryAccess.`getIntAtIndex(MemorySegment segment, long index, ByteOrder order)`
Reads an int from given segment and element index, with given byte order.
`static int`
MemoryAccess.`getIntAtOffset(MemorySegment segment, long offset, ByteOrder order)`
Reads an int from given segment and offset with given byte order.
`static long`
MemoryAccess.`getLong(MemorySegment segment, ByteOrder order)`
Reads a long from given segment, with given byte order.
`static long`
MemoryAccess.`getLongAtIndex(MemorySegment segment, long index, ByteOrder order)`
Reads a long from given segment and element index, with given byte order.
`static long`
MemoryAccess.`getLongAtOffset(MemorySegment segment, long offset, ByteOrder order)`
Reads a long from given segment and offset with given byte order.
`static short`
MemoryAccess.`getShort(MemorySegment segment, ByteOrder order)`
Reads a short from given segment, with given byte order.
`static short`
MemoryAccess.`getShortAtIndex(MemorySegment segment, long index, ByteOrder order)`
Reads a short from given segment and element index, with given byte order.
`static short`
MemoryAccess.`getShortAtOffset(MemorySegment segment, long offset, ByteOrder order)`
Reads a short from given segment and offset with given byte order.
`static void`
MemoryAccess.`setChar(MemorySegment segment, ByteOrder order, char value)`
Writes a char at given segment, with given byte order.
`static void`
MemoryAccess.`setCharAtIndex(MemorySegment segment, long index, ByteOrder order, char value)`
Writes a char at given segment and element index, with given byte order.
`static void`
MemoryAccess.`setCharAtOffset(MemorySegment segment, long offset, ByteOrder order, char value)`
Writes a char at given segment and offset with given byte order.
`static void`
MemoryAccess.`setDouble(MemorySegment segment, ByteOrder order, double value)`
Writes a double at given segment, with given byte order.
`static void`
MemoryAccess.`setDoubleAtIndex(MemorySegment segment, long index, ByteOrder order, double value)`
Writes a double at given segment and element index, with given byte order.
`static void`
MemoryAccess.`setDoubleAtOffset(MemorySegment segment, long offset, ByteOrder order, double value)`
Writes a double at given segment and offset with given byte order.
`static void`
MemoryAccess.`setFloat(MemorySegment segment, ByteOrder order, float value)`
Writes a float at given segment, with given byte order.
`static void`
MemoryAccess.`setFloatAtIndex(MemorySegment segment, long index, ByteOrder order, float value)`
Writes a float at given segment and element index, with given byte order.
`static void`
MemoryAccess.`setFloatAtOffset(MemorySegment segment, long offset, ByteOrder order, float value)`
Writes a float at given segment and offset with given byte order.
`static void`
MemoryAccess.`setInt(MemorySegment segment, ByteOrder order, int value)`
Writes an int at given segment, with given byte order.
`static void`
MemoryAccess.`setIntAtIndex(MemorySegment segment, long index, ByteOrder order, int value)`
Writes an int at given segment and element index, with given byte order.
`static void`
MemoryAccess.`setIntAtOffset(MemorySegment segment, long offset, ByteOrder order, int value)`
Writes an int at given segment and offset with given byte order.
`static void`
MemoryAccess.`setLong(MemorySegment segment, ByteOrder order, long value)`
Writes a long at given segment, with given byte order.
`static void`
MemoryAccess.`setLongAtIndex(MemorySegment segment, long index, ByteOrder order, long value)`
Writes a long at given segment and element index, with given byte order.
`static void`
MemoryAccess.`setLongAtOffset(MemorySegment segment, long offset, ByteOrder order, long value)`
Writes a long at given segment and offset with given byte order.
`static void`
MemoryAccess.`setShort(MemorySegment segment, ByteOrder order, short value)`
Writes a short at given segment, with given byte order.
`static void`
MemoryAccess.`setShortAtIndex(MemorySegment segment, long index, ByteOrder order, short value)`
Writes a short at given segment and element index, with given byte order.
`static void`
MemoryAccess.`setShortAtOffset(MemorySegment segment, long offset, ByteOrder order, short value)`
Writes a short at given segment and offset with given byte order.
`static ValueLayout`
MemoryLayout.`valueLayout(long size, ByteOrder order)`
Create a value layout of given byte order and size.
`static VarHandle`
MemoryHandles.`varHandle(Class<?> carrier, long alignmentBytes, ByteOrder byteOrder)`
Creates a memory access var handle with the given carrier type, alignment constraint, and byte order.
`static VarHandle`
MemoryHandles.`varHandle(Class<?> carrier, ByteOrder byteOrder)`
Creates a memory access var handle with the given carrier type and byte order.
`ValueLayout`
ValueLayout.`withOrder(ByteOrder order)`
Returns a new value layout with given byte order.

## Uses of ByteOrder in jdk.incubator.vector

Methods in jdk.incubator.vector with parameters of type ByteOrder
Modifier and Type
Method
Description
`static ByteVector`
ByteVector.`fromByteArray(VectorSpecies<Byte> species, byte[] a, int offset, ByteOrder bo)`
Loads a vector from a byte array starting at an offset.
`static ByteVector`
ByteVector.`fromByteArray(VectorSpecies<Byte> species, byte[] a, int offset, ByteOrder bo, VectorMask<Byte> m)`
Loads a vector from a byte array starting at an offset and using a mask.
`static DoubleVector`
DoubleVector.`fromByteArray(VectorSpecies<Double> species, byte[] a, int offset, ByteOrder bo)`
Loads a vector from a byte array starting at an offset.
`static DoubleVector`
DoubleVector.`fromByteArray(VectorSpecies<Double> species, byte[] a, int offset, ByteOrder bo, VectorMask<Double> m)`
Loads a vector from a byte array starting at an offset and using a mask.
`static FloatVector`
FloatVector.`fromByteArray(VectorSpecies<Float> species, byte[] a, int offset, ByteOrder bo)`
Loads a vector from a byte array starting at an offset.
`static FloatVector`
FloatVector.`fromByteArray(VectorSpecies<Float> species, byte[] a, int offset, ByteOrder bo, VectorMask<Float> m)`
Loads a vector from a byte array starting at an offset and using a mask.
`static IntVector`
IntVector.`fromByteArray(VectorSpecies<Integer> species, byte[] a, int offset, ByteOrder bo)`
Loads a vector from a byte array starting at an offset.
`static IntVector`
IntVector.`fromByteArray(VectorSpecies<Integer> species, byte[] a, int offset, ByteOrder bo, VectorMask<Integer> m)`
Loads a vector from a byte array starting at an offset and using a mask.
`static LongVector`
LongVector.`fromByteArray(VectorSpecies<Long> species, byte[] a, int offset, ByteOrder bo)`
Loads a vector from a byte array starting at an offset.
`static LongVector`
LongVector.`fromByteArray(VectorSpecies<Long> species, byte[] a, int offset, ByteOrder bo, VectorMask<Long> m)`
Loads a vector from a byte array starting at an offset and using a mask.
`static ShortVector`
ShortVector.`fromByteArray(VectorSpecies<Short> species, byte[] a, int offset, ByteOrder bo)`
Loads a vector from a byte array starting at an offset.
`static ShortVector`
ShortVector.`fromByteArray(VectorSpecies<Short> species, byte[] a, int offset, ByteOrder bo, VectorMask<Short> m)`
Loads a vector from a byte array starting at an offset and using a mask.
`Vector<E>`
VectorSpecies.`fromByteArray(byte[] a, int offset, ByteOrder bo)`
Loads a vector of this species from a byte array starting at an offset.
`static ByteVector`
ByteVector.`fromByteBuffer(VectorSpecies<Byte> species, ByteBuffer bb, int offset, ByteOrder bo)`
Loads a vector from a byte buffer starting at an offset into the byte buffer.
`static ByteVector`
ByteVector.`fromByteBuffer(VectorSpecies<Byte> species, ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Byte> m)`
Loads a vector from a byte buffer starting at an offset into the byte buffer and using a mask.
`static DoubleVector`
DoubleVector.`fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int offset, ByteOrder bo)`
Loads a vector from a byte buffer starting at an offset into the byte buffer.
`static DoubleVector`
DoubleVector.`fromByteBuffer(VectorSpecies<Double> species, ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Double> m)`
Loads a vector from a byte buffer starting at an offset into the byte buffer and using a mask.
`static FloatVector`
FloatVector.`fromByteBuffer(VectorSpecies<Float> species, ByteBuffer bb, int offset, ByteOrder bo)`
Loads a vector from a byte buffer starting at an offset into the byte buffer.
`static FloatVector`
FloatVector.`fromByteBuffer(VectorSpecies<Float> species, ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Float> m)`
Loads a vector from a byte buffer starting at an offset into the byte buffer and using a mask.
`static IntVector`
IntVector.`fromByteBuffer(VectorSpecies<Integer> species, ByteBuffer bb, int offset, ByteOrder bo)`
Loads a vector from a byte buffer starting at an offset into the byte buffer.
`static IntVector`
IntVector.`fromByteBuffer(VectorSpecies<Integer> species, ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Integer> m)`
Loads a vector from a byte buffer starting at an offset into the byte buffer and using a mask.
`static LongVector`
LongVector.`fromByteBuffer(VectorSpecies<Long> species, ByteBuffer bb, int offset, ByteOrder bo)`
Loads a vector from a byte buffer starting at an offset into the byte buffer.
`static LongVector`
LongVector.`fromByteBuffer(VectorSpecies<Long> species, ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Long> m)`
Loads a vector from a byte buffer starting at an offset into the byte buffer and using a mask.
`static ShortVector`
ShortVector.`fromByteBuffer(VectorSpecies<Short> species, ByteBuffer bb, int offset, ByteOrder bo)`
Loads a vector from a byte buffer starting at an offset into the byte buffer.
`static ShortVector`
ShortVector.`fromByteBuffer(VectorSpecies<Short> species, ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Short> m)`
Loads a vector from a byte buffer starting at an offset into the byte buffer and using a mask.
`final void`
ByteVector.`intoByteArray(byte[] a, int offset, ByteOrder bo)`
Stores this vector into a byte array starting at an offset using explicit byte order.
`final void`
ByteVector.`intoByteArray(byte[] a, int offset, ByteOrder bo, VectorMask<Byte> m)`
Stores this vector into a byte array starting at an offset using explicit byte order and a mask.
`final void`
DoubleVector.`intoByteArray(byte[] a, int offset, ByteOrder bo)`
Stores this vector into a byte array starting at an offset using explicit byte order.
`final void`
DoubleVector.`intoByteArray(byte[] a, int offset, ByteOrder bo, VectorMask<Double> m)`
Stores this vector into a byte array starting at an offset using explicit byte order and a mask.
`final void`
FloatVector.`intoByteArray(byte[] a, int offset, ByteOrder bo)`
Stores this vector into a byte array starting at an offset using explicit byte order.
`final void`
FloatVector.`intoByteArray(byte[] a, int offset, ByteOrder bo, VectorMask<Float> m)`
Stores this vector into a byte array starting at an offset using explicit byte order and a mask.
`final void`
IntVector.`intoByteArray(byte[] a, int offset, ByteOrder bo)`
Stores this vector into a byte array starting at an offset using explicit byte order.
`final void`
IntVector.`intoByteArray(byte[] a, int offset, ByteOrder bo, VectorMask<Integer> m)`
Stores this vector into a byte array starting at an offset using explicit byte order and a mask.
`final void`
LongVector.`intoByteArray(byte[] a, int offset, ByteOrder bo)`
Stores this vector into a byte array starting at an offset using explicit byte order.
`final void`
LongVector.`intoByteArray(byte[] a, int offset, ByteOrder bo, VectorMask<Long> m)`
Stores this vector into a byte array starting at an offset using explicit byte order and a mask.
`final void`
ShortVector.`intoByteArray(byte[] a, int offset, ByteOrder bo)`
Stores this vector into a byte array starting at an offset using explicit byte order.
`final void`
ShortVector.`intoByteArray(byte[] a, int offset, ByteOrder bo, VectorMask<Short> m)`
Stores this vector into a byte array starting at an offset using explicit byte order and a mask.
`abstract void`
Vector.`intoByteArray(byte[] a, int offset, ByteOrder bo)`
Stores this vector into a byte array starting at an offset using explicit byte order.
`abstract void`
Vector.`intoByteArray(byte[] a, int offset, ByteOrder bo, VectorMask<E> m)`
Stores this vector into a byte array starting at an offset using explicit byte order and a mask.
`final void`
ByteVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo)`
Stores this vector into a byte buffer starting at an offset using explicit byte order.
`final void`
ByteVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Byte> m)`
Stores this vector into a byte buffer starting at an offset using explicit byte order and a mask.
`final void`
DoubleVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo)`
Stores this vector into a byte buffer starting at an offset using explicit byte order.
`final void`
DoubleVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Double> m)`
Stores this vector into a byte buffer starting at an offset using explicit byte order and a mask.
`final void`
FloatVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo)`
Stores this vector into a byte buffer starting at an offset using explicit byte order.
`final void`
FloatVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Float> m)`
Stores this vector into a byte buffer starting at an offset using explicit byte order and a mask.
`final void`
IntVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo)`
Stores this vector into a byte buffer starting at an offset using explicit byte order.
`final void`
IntVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Integer> m)`
Stores this vector into a byte buffer starting at an offset using explicit byte order and a mask.
`final void`
LongVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo)`
Stores this vector into a byte buffer starting at an offset using explicit byte order.
`final void`
LongVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Long> m)`
Stores this vector into a byte buffer starting at an offset using explicit byte order and a mask.
`final void`
ShortVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo)`
Stores this vector into a byte buffer starting at an offset using explicit byte order.
`final void`
ShortVector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo, VectorMask<Short> m)`
Stores this vector into a byte buffer starting at an offset using explicit byte order and a mask.
`abstract void`
Vector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo)`
Stores this vector into a byte buffer starting at an offset using explicit byte order.
`abstract void`
Vector.`intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo, VectorMask<E> m)`
Stores this vector into a byte buffer starting at an offset using explicit byte order and a mask.