Stay organized with collections
Save and categorize content based on your preferences.
ByteOrder
class ByteOrder
A typesafe enumeration for byte orders.
Summary
Public methods |
static ByteOrder! |
Retrieves the native byte order of the underlying platform.
|
String |
Constructs a string describing this object.
|
Properties |
static ByteOrder! |
Constant denoting big-endian byte order.
|
static ByteOrder! |
Constant denoting little-endian byte order.
|
Public methods
nativeOrder
static fun nativeOrder(): ByteOrder!
Retrieves the native byte order of the underlying platform.
This method is defined so that performance-sensitive Java code can allocate direct buffers with the same byte order as the hardware. Native code libraries are often more efficient when such buffers are used.
Return |
ByteOrder! |
The native byte order of the hardware upon which this Java virtual machine is running |
toString
fun toString(): String
Constructs a string describing this object.
This method returns the string "BIG_ENDIAN"
for BIG_ENDIAN
and "LITTLE_ENDIAN"
for LITTLE_ENDIAN
.
Return |
String |
The specified string |
Properties
BIG_ENDIAN
static val BIG_ENDIAN: ByteOrder!
Constant denoting big-endian byte order. In this order, the bytes of a multibyte value are ordered from most significant to least significant.
LITTLE_ENDIAN
static val LITTLE_ENDIAN: ByteOrder!
Constant denoting little-endian byte order. In this order, the bytes of a multibyte value are ordered from least significant to most significant.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ByteOrder\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nByteOrder\n=========\n\n```\nclass ByteOrder\n```\n\n|---|-------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.nio.ByteOrder](#) |\n\nA typesafe enumeration for byte orders.\n\nSummary\n-------\n\n| Public methods ||\n|----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| static [ByteOrder](#)! | [nativeOrder](#nativeOrder())`()` Retrieves the native byte order of the underlying platform. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` Constructs a string describing this object. |\n\n| Properties ||\n|------------------------|------------------------------------------------------------------------------------------------|\n| static [ByteOrder](#)! | [BIG_ENDIAN](#BIG_ENDIAN:java.nio.ByteOrder) Constant denoting big-endian byte order. |\n| static [ByteOrder](#)! | [LITTLE_ENDIAN](#LITTLE_ENDIAN:java.nio.ByteOrder) Constant denoting little-endian byte order. |\n\nPublic methods\n--------------\n\n### nativeOrder\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun nativeOrder(): ByteOrder!\n```\n\nRetrieves the native byte order of the underlying platform.\n\nThis method is defined so that performance-sensitive Java code can allocate direct buffers with the same byte order as the hardware. Native code libraries are often more efficient when such buffers are used.\n\n| Return ||\n|-----------------|---------------------------------------------------------------------------------------|\n| [ByteOrder](#)! | The native byte order of the hardware upon which this Java virtual machine is running |\n\n### toString\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\nConstructs a string describing this object.\n\nThis method returns the string `\"BIG_ENDIAN\"` for [BIG_ENDIAN](#BIG_ENDIAN:java.nio.ByteOrder) and `\"LITTLE_ENDIAN\"` for [LITTLE_ENDIAN](#LITTLE_ENDIAN:java.nio.ByteOrder).\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | The specified string |\n\nProperties\n----------\n\n### BIG_ENDIAN\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val BIG_ENDIAN: ByteOrder!\n```\n\nConstant denoting big-endian byte order. In this order, the bytes of a multibyte value are ordered from most significant to least significant. \n\n### LITTLE_ENDIAN\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val LITTLE_ENDIAN: ByteOrder!\n```\n\nConstant denoting little-endian byte order. In this order, the bytes of a multibyte value are ordered from least significant to most significant."]]