package Ġde . to bias blas ch ke . mid ip i . lib . utils Ċ Ċ import Ġjava . lang . IllegalArgumentException Ċ import Ġkotlin . experimental . and Ċ import Ġkotlin . experimental . inv Ċ import Ġkotlin . experimental . or Ċ import Ġkotlin . experimental . xor Ċ Ċ @ Suppress (" NON _ PUBLIC _ PRIMARY _ CON STRUCTOR _ OF _ INLINE _ CLASS ") Ċ @ Opt In ( Experimental Unsigned Types :: class ) Ċ public Ġclass ĠUN ib ble Ġ@ Published Api Ġinternal Ġconstructor (@ Published Api Ġinternal Ġval Ġdata : ĠByte ): ĠComparable < UN ib ble > Ġ{ ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġpublic Ġval ĠMIN _ VALUE : ĠUN ib ble Ġ= ĠUN ib ble ( 0 ) ĊĠĠĠĠĠĠĠ Ġpublic Ġval ĠMAX _ VALUE : ĠUN ib ble Ġ= ĠUN ib ble ( 0 x 0 F ) ĊĊĠĠĠĠĠĠĠ Ġpublic Ġconst Ġval ĠSIZE _ BYTES : ĠInt Ġ= Ġ 1 ĊĠĠĠĠĠĠĠ Ġpublic Ġconst Ġval ĠSIZE _ BITS : ĠInt Ġ= Ġ 4 ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġif ( data Ġ>= Ġ 0 x 8 0 ) Ġthrow ĠIllegalArgumentException (" UN ib ble Ġcan Ġonly Ġhold Ġvalues Ġup Ġto Ġ 0 x 7 F ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Suppress (" OVERRIDE _ BY _ INLINE ") ĊĠĠĠ Ġpublic Ġoverride Ġinline Ġoperator Ġfun Ġcompare To ( other : ĠUN ib ble ): ĠInt Ġ= Ġthis . toInt (). compareTo ( other . toInt ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġcompare To ( other : ĠU Byte ): ĠInt Ġ= Ġthis . toInt (). compareTo ( other . toInt ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġcompare To ( other : ĠU Short ): ĠInt Ġ= Ġthis . toInt (). compareTo ( other . toInt ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġcompare To ( other : ĠUInt ): ĠInt Ġ= Ġthis . to UInt (). compareTo ( other ) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġcompare To ( other : ĠU Long ): ĠInt Ġ= Ġthis . to UL ong (). compareTo ( other ) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġcompare To ( other : ĠU Byte 7 ): ĠInt Ġ= Ġthis . toInt (). compareTo ( other . toInt ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġcompare To ( other : ĠU Short 7 ): ĠInt Ġ= Ġthis . toInt (). compareTo ( other . toInt ()) ĊĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġplus ( other : ĠUN ib ble ): ĠU Byte 7 Ġ= ĠU Byte 7 ((( data Ġ+ Ġother . to Byte ()) Ġ% Ġ 0 x 8 0 ). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġplus ( other : ĠU Byte ): ĠU Short 7 Ġ= ĠU Short 7 ((( data Ġ+ Ġother . to Byte ()) Ġ% Ġ 0 x 4 0 0 0 ). to Short ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġplus ( other : ĠU Short ): ĠU Short 7 Ġ= ĠU Short 7 ((( data Ġ+ Ġother . to Short ()) Ġ% Ġ 0 x 4 0 0 0 ). to Short ()) ĊĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġtimes ( other : ĠUN ib ble ): ĠUInt Ġ= Ġthis . to UInt (). times ( other . to UInt ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġtimes ( other : ĠU Byte ): ĠUInt Ġ= Ġthis . to UInt (). times ( other ) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġtimes ( other : ĠU Short ): ĠUInt Ġ= Ġthis . to UInt (). times ( other ) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġtimes ( other : ĠUInt ): ĠUInt Ġ= Ġthis . to UInt (). times ( other ) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġtimes ( other : ĠU Long ): ĠU Long Ġ= Ġthis . to UL ong (). times ( other ) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġtimes ( other : ĠU Byte 7 ): ĠUInt Ġ= Ġthis . to UInt (). times ( other . to UInt ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġtimes ( other : ĠU Short 7 ): ĠUInt Ġ= Ġthis . to UInt (). times ( other . to UInt ()) ĊĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġdiv ( other : ĠUN ib ble ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ/ Ġother . data ). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġdiv ( other : ĠU Byte 7 ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ/ Ġother . data ). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġdiv ( other : ĠU Short 7 ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ/ Ġother . data ). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġdiv ( other : ĠUInt ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ/ Ġother . to Byte ()). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġdiv ( other : ĠU Long ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ/ Ġother . to Byte ()). to Byte ()) ĊĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġrem ( other : ĠUN ib ble ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ% Ġother . data ). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġrem ( other : ĠU Byte 7 ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ% Ġother . data ). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġrem ( other : ĠU Short 7 ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ% Ġother . data ). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġrem ( other : ĠUInt ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ% Ġother . to Byte ()). to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġrem ( other : ĠU Long ): ĠUN ib ble Ġ= ĠUN ib ble (( data Ġ% Ġother . to Byte ()). to Byte ()) ĊĊĠĠĠ Ġpublic Ġinline Ġoperator Ġfun Ġrange To ( other : ĠUN ib ble ): ĠUInt Range Ġ= ĠUInt Range ( this . to UInt (), Ġother . to UInt ()) ĊĊĠĠĠ Ġpublic Ġinline Ġin fix Ġfun Ġand ( other : ĠUN ib ble ): ĠUN ib ble Ġ= ĠUN ib ble ( this . data Ġand Ġother . data ) ĊĠĠĠ Ġpublic Ġinline Ġin fix Ġfun Ġor ( other : ĠUN ib ble ): ĠUN ib ble Ġ= ĠUN ib ble ( this . data Ġor Ġother . data ) ĊĠĠĠ Ġpublic Ġinline Ġin fix Ġfun Ġxor ( other : ĠUN ib ble ): ĠUN ib ble Ġ= ĠUN ib ble ( this . data Ġxor Ġother . data ) ĊĠĠĠ Ġpublic Ġinline Ġfun Ġinv (): ĠUN ib ble Ġ= ĠUN ib ble ( data . inv () Ġand Ġ 0 x 0 F ) ĊĊĠĠĠ Ġpublic Ġinline Ġin fix Ġfun Ġand ( other : ĠU Byte ): ĠUN ib ble Ġ= ĠUN ib ble ( this . data Ġand Ġother . to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġin fix Ġfun Ġor ( other : ĠU Byte ): ĠUN ib ble Ġ= ĠUN ib ble ( this . data Ġor Ġother . to Byte ()) ĊĠĠĠ Ġpublic Ġinline Ġin fix Ġfun Ġxor ( other : ĠU Byte ): ĠUN ib ble Ġ= ĠUN ib ble ( this . data Ġxor Ġother . to Byte ()) ĊĊĠĠĠ Ġpublic Ġinline Ġfun Ġto Byte (): ĠByte Ġ= Ġdata ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto Short (): ĠShort Ġ= Ġdata . to Short () Ġand Ġ 0 x 7 F ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto Int (): ĠInt Ġ= Ġdata . toInt () Ġand Ġ 0 x 7 F ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto Long (): ĠLong Ġ= Ġdata . to Long () Ġand Ġ 0 x 7 F ĊĊĠĠĠ Ġpublic Ġinline Ġfun Ġto U Byte (): ĠU Byte Ġ= Ġdata . to U Byte () ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto U Short (): ĠU Short Ġ= Ġdata . to U Short () ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto UInt (): ĠUInt Ġ= Ġdata . to UInt () ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto UL ong (): ĠU Long Ġ= Ġdata . to UL ong () ĊĊĠĠĠ Ġpublic Ġinline Ġfun Ġto UN ib ble (): ĠUN ib ble Ġ= Ġthis ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto U Byte 7 (): ĠU Byte 7 Ġ= ĠU Byte 7 ( this . data ) ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto U Short 7 (): ĠU Short 7 Ġ= ĠU Short 7 ( U Byte 7 . MIN _ VALUE , Ġthis . to U Byte 7 ()) ĊĠĠĠ Ġ// ĠĠĠ Ġpublic Ġinline Ġfun Ġto UInt 7 (): ĠUInt Ġ= ĠUInt ( data . toInt () Ġand Ġ 0 xFF ) Ċ // ĠĠĠ Ġpublic Ġinline Ġfun Ġto UL ong 7 (): ĠU Long Ġ= ĠU Long ( data . to Long () Ġand Ġ 0 xFF ) ĊĊĠĠĠ Ġpublic Ġinline Ġfun Ġto Float (): ĠFloat Ġ= Ġthis . toInt (). toFloat () ĊĠĠĠ Ġpublic Ġinline Ġfun Ġto Double (): ĠDouble Ġ= Ġthis . toInt (). toDouble () ĊĊĠĠĠ Ġoverride Ġfun Ġequals ( other : ĠAny ?): ĠBoolean Ġ= Ġwhen ( other ) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠU Byte , Ġis ĠU Short , Ġis ĠUInt , Ġis ĠU Long Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġto UInt () Ġ== Ġother ĊĠĠĠĠĠĠĠ Ġis ĠUN ib ble Ġ-> Ġdata Ġ== Ġother . data ĊĠĠĠĠĠĠĠ Ġis ĠU Byte 7 Ġ-> Ġdata Ġ== Ġother . data ĊĠĠĠĠĠĠĠ Ġis ĠU Short 7 Ġ-> Ġdata Ġ== Ġ( other . data . to Byte () Ġ% Ġ 0 x 8 0 ). to Byte () ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġfalse ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠhashCode (): ĠInt Ġ= ĊĠĠĠĠĠĠĠ Ġto UInt (). hashCode () ĊĊĠĠĠ Ġpublic Ġoverride Ġfun ĠtoString (): ĠString Ġ= ĊĠĠĠĠĠĠĠ ĠString . format (" 0 x % X ", Ġto Int ()) Ċ } Ċ Ċ public Ġfun ĠByte . to UN ib ble (): ĠUN ib ble Ġ= ĠUN ib ble ( this Ġand Ġ 0 x 0 F ) Ċ public Ġfun ĠShort . to UN ib ble (): ĠUN ib ble Ġ= ĠUN ib ble ( this . to Byte () Ġand Ġ 0 x 0 F ) Ċ public Ġfun ĠInt . to UN ib ble (): ĠUN ib ble Ġ= ĠUN ib ble ( this . to Byte () Ġand Ġ 0 x 0 F ) Ċ public Ġfun ĠLong . to UN ib ble (): ĠUN ib ble Ġ= ĠUN ib ble ( this . to Byte () Ġand Ġ 0 x 0 F ) Ċ Ċ public Ġfun ĠU Byte . to UN ib ble (): ĠUN ib ble Ġ= ĠUN ib ble ( this . to Byte () Ġand Ġ 0 x 0 F ) Ċ public Ġfun ĠUInt . to UN ib ble (): ĠUN ib ble Ġ= ĠUN ib ble ( this . to Byte () Ġand Ġ 0 x 0 F ) Ċ public Ġfun ĠU Short . to UN ib ble (): ĠUN ib ble Ġ= ĠUN ib ble ( this . to Byte () Ġand Ġ 0 x 0 F ) Ċ public Ġfun ĠU Long . to UN ib ble (): ĠUN ib ble Ġ= ĠUN ib ble ( this . to Byte () Ġand Ġ 0 x 0 F ) Ċ