diff --git a/library/endian/api/endian.api b/library/endian/api/endian.api index 22dbb33..0e96112 100644 --- a/library/endian/api/endian.api +++ b/library/endian/api/endian.api @@ -1,5 +1,4 @@ public abstract class org/kotlincrypto/bitops/endian/Endian { - public static final field Companion Lorg/kotlincrypto/bitops/endian/Endian$Companion; public abstract fun intFrom ([BI)I public abstract fun intOf (BBBB)I public abstract fun longFrom ([BI)J @@ -66,9 +65,6 @@ public final class org/kotlincrypto/bitops/endian/Endian$Big : org/kotlincrypto/ public fun shortOf (BB)S } -public final class org/kotlincrypto/bitops/endian/Endian$Companion { -} - public final class org/kotlincrypto/bitops/endian/Endian$Little : org/kotlincrypto/bitops/endian/Endian { public static final field INSTANCE Lorg/kotlincrypto/bitops/endian/Endian$Little; public fun equals (Ljava/lang/Object;)Z @@ -108,84 +104,3 @@ public final class org/kotlincrypto/bitops/endian/Endian$Little : org/kotlincryp public fun shortOf (BB)S } -public abstract interface annotation class org/kotlincrypto/bitops/endian/InternalEndianApi : java/lang/annotation/Annotation { -} - -public final class org/kotlincrypto/bitops/endian/_EndianInlineKt { - public static final fun beInlineIntFrom (Lorg/kotlincrypto/bitops/endian/Endian$Companion;[BI)I - public static final fun beInlineIntOf (Lorg/kotlincrypto/bitops/endian/Endian$Companion;BBBB)I - public static final fun beInlineLongFrom (Lorg/kotlincrypto/bitops/endian/Endian$Companion;[BI)J - public static final fun beInlineLongOf (Lorg/kotlincrypto/bitops/endian/Endian$Companion;BBBBBBBB)J - public static final fun beInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;I[BI)[B - public static final fun beInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;I[BIII)[B - public static final fun beInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;J[BI)[B - public static final fun beInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;J[BIII)[B - public static final fun beInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;S[BI)[B - public static final fun beInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;S[BIII)[B - public static synthetic fun beInlinePackUnsafe$default (Lorg/kotlincrypto/bitops/endian/Endian$Companion;I[BIIIILjava/lang/Object;)[B - public static synthetic fun beInlinePackUnsafe$default (Lorg/kotlincrypto/bitops/endian/Endian$Companion;J[BIIIILjava/lang/Object;)[B - public static synthetic fun beInlinePackUnsafe$default (Lorg/kotlincrypto/bitops/endian/Endian$Companion;S[BIIIILjava/lang/Object;)[B - public static final fun beInlineShortFrom (Lorg/kotlincrypto/bitops/endian/Endian$Companion;[BI)S - public static final fun beInlineShortOf (Lorg/kotlincrypto/bitops/endian/Endian$Companion;BB)S - public static final fun leInlineIntFrom (Lorg/kotlincrypto/bitops/endian/Endian$Companion;[BI)I - public static final fun leInlineIntOf (Lorg/kotlincrypto/bitops/endian/Endian$Companion;BBBB)I - public static final fun leInlineLongFrom (Lorg/kotlincrypto/bitops/endian/Endian$Companion;[BI)J - public static final fun leInlineLongOf (Lorg/kotlincrypto/bitops/endian/Endian$Companion;BBBBBBBB)J - public static final fun leInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;I[BI)[B - public static final fun leInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;I[BIII)[B - public static final fun leInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;J[BI)[B - public static final fun leInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;J[BIII)[B - public static final fun leInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;S[BI)[B - public static final fun leInlinePackUnsafe (Lorg/kotlincrypto/bitops/endian/Endian$Companion;S[BIII)[B - public static synthetic fun leInlinePackUnsafe$default (Lorg/kotlincrypto/bitops/endian/Endian$Companion;I[BIIIILjava/lang/Object;)[B - public static synthetic fun leInlinePackUnsafe$default (Lorg/kotlincrypto/bitops/endian/Endian$Companion;J[BIIIILjava/lang/Object;)[B - public static synthetic fun leInlinePackUnsafe$default (Lorg/kotlincrypto/bitops/endian/Endian$Companion;S[BIIIILjava/lang/Object;)[B - public static final fun leInlineShortFrom (Lorg/kotlincrypto/bitops/endian/Endian$Companion;[BI)S - public static final fun leInlineShortOf (Lorg/kotlincrypto/bitops/endian/Endian$Companion;BB)S - public static final fun longOf (Lorg/kotlincrypto/bitops/endian/Endian$Companion;II)J -} - -public final class org/kotlincrypto/bitops/endian/internal/B0 { - public static final synthetic fun box-impl (B)Lorg/kotlincrypto/bitops/endian/internal/B0; - public static fun constructor-impl (B)B - public fun equals (Ljava/lang/Object;)Z - public static fun equals-impl (BLjava/lang/Object;)Z - public static final fun equals-impl0 (BB)Z - public fun hashCode ()I - public static fun hashCode-impl (B)I - public fun toString ()Ljava/lang/String; - public static fun toString-impl (B)Ljava/lang/String; - public final synthetic fun unbox-impl ()B -} - -public final class org/kotlincrypto/bitops/endian/internal/Lo { - public static final synthetic fun box-impl (I)Lorg/kotlincrypto/bitops/endian/internal/Lo; - public static fun constructor-impl (I)I - public fun equals (Ljava/lang/Object;)Z - public static fun equals-impl (ILjava/lang/Object;)Z - public static final fun equals-impl0 (II)Z - public fun hashCode ()I - public static fun hashCode-impl (I)I - public fun toString ()Ljava/lang/String; - public static fun toString-impl (I)Ljava/lang/String; - public final synthetic fun unbox-impl ()I -} - -public final class org/kotlincrypto/bitops/endian/internal/_EndianUtilsKt { - public static final fun packAllElsePartial ([BIIIILkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)[B - public static final fun packBEInt ([BII)[B - public static final fun packBELong ([BJI)[B - public static final fun packBEShort ([BSI)[B - public static final fun packLEInt ([BII)[B - public static final fun packLELong ([BJI)[B - public static final fun packLEShort ([BSI)[B - public static final fun packPartial ([BIIILkotlin/jvm/functions/Function1;)[B - public static final fun toBEInt-_EY57KE (BBBB)I - public static final fun toBELong-23fJcIY (BBBBBBBB)J - public static final fun toBEShort-qNA_5i4 (BB)S - public static final fun toLEInt-_EY57KE (BBBB)I - public static final fun toLELong-23fJcIY (BBBBBBBB)J - public static final fun toLEShort-qNA_5i4 (BB)S - public static final fun toLong-DL1PAzY (II)J -} - diff --git a/library/endian/api/endian.klib.api b/library/endian/api/endian.klib.api index 6f2d407..e3cc786 100644 --- a/library/endian/api/endian.klib.api +++ b/library/endian/api/endian.klib.api @@ -6,32 +6,6 @@ // - Show declarations: true // Library unique name: -open annotation class org.kotlincrypto.bitops.endian/InternalEndianApi : kotlin/Annotation { // org.kotlincrypto.bitops.endian/InternalEndianApi|null[0] - constructor () // org.kotlincrypto.bitops.endian/InternalEndianApi.|(){}[0] -} - -final value class org.kotlincrypto.bitops.endian.internal/B0 { // org.kotlincrypto.bitops.endian.internal/B0|null[0] - constructor (kotlin/Byte) // org.kotlincrypto.bitops.endian.internal/B0.|(kotlin.Byte){}[0] - - final val b0 // org.kotlincrypto.bitops.endian.internal/B0.b0|{}b0[0] - final fun (): kotlin/Byte // org.kotlincrypto.bitops.endian.internal/B0.b0.|(){}[0] - - final fun equals(kotlin/Any?): kotlin/Boolean // org.kotlincrypto.bitops.endian.internal/B0.equals|equals(kotlin.Any?){}[0] - final fun hashCode(): kotlin/Int // org.kotlincrypto.bitops.endian.internal/B0.hashCode|hashCode(){}[0] - final fun toString(): kotlin/String // org.kotlincrypto.bitops.endian.internal/B0.toString|toString(){}[0] -} - -final value class org.kotlincrypto.bitops.endian.internal/Lo { // org.kotlincrypto.bitops.endian.internal/Lo|null[0] - constructor (kotlin/Int) // org.kotlincrypto.bitops.endian.internal/Lo.|(kotlin.Int){}[0] - - final val lo // org.kotlincrypto.bitops.endian.internal/Lo.lo|{}lo[0] - final fun (): kotlin/Int // org.kotlincrypto.bitops.endian.internal/Lo.lo.|(){}[0] - - final fun equals(kotlin/Any?): kotlin/Boolean // org.kotlincrypto.bitops.endian.internal/Lo.equals|equals(kotlin.Any?){}[0] - final fun hashCode(): kotlin/Int // org.kotlincrypto.bitops.endian.internal/Lo.hashCode|hashCode(){}[0] - final fun toString(): kotlin/String // org.kotlincrypto.bitops.endian.internal/Lo.toString|toString(){}[0] -} - sealed class org.kotlincrypto.bitops.endian/Endian { // org.kotlincrypto.bitops.endian/Endian|null[0] abstract fun intFrom(kotlin/ByteArray, kotlin/Int): kotlin/Int // org.kotlincrypto.bitops.endian/Endian.intFrom|intFrom(kotlin.ByteArray;kotlin.Int){}[0] abstract fun intOf(kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Int // org.kotlincrypto.bitops.endian/Endian.intOf|intOf(kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] @@ -85,8 +59,6 @@ sealed class org.kotlincrypto.bitops.endian/Endian { // org.kotlincrypto.bitops. final inline fun (kotlin/ByteArray).beShortAt(kotlin/Int): kotlin/Short // org.kotlincrypto.bitops.endian/Endian.Big.beShortAt|beShortAt@kotlin.ByteArray(kotlin.Int){}[0] } - final object Companion // org.kotlincrypto.bitops.endian/Endian.Companion|null[0] - final object Little : org.kotlincrypto.bitops.endian/Endian { // org.kotlincrypto.bitops.endian/Endian.Little|null[0] final fun equals(kotlin/Any?): kotlin/Boolean // org.kotlincrypto.bitops.endian/Endian.Little.equals|equals(kotlin.Any?){}[0] final fun hashCode(): kotlin/Int // org.kotlincrypto.bitops.endian/Endian.Little.hashCode|hashCode(){}[0] @@ -119,44 +91,3 @@ sealed class org.kotlincrypto.bitops.endian/Endian { // org.kotlincrypto.bitops. final inline fun (kotlin/ByteArray).leShortAt(kotlin/Int): kotlin/Short // org.kotlincrypto.bitops.endian/Endian.Little.leShortAt|leShortAt@kotlin.ByteArray(kotlin.Int){}[0] } } - -final inline fun (kotlin/ByteArray).org.kotlincrypto.bitops.endian.internal/packAllElsePartial(kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Function1, kotlin/Function1): kotlin/ByteArray // org.kotlincrypto.bitops.endian.internal/packAllElsePartial|packAllElsePartial@kotlin.ByteArray(kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Function1;kotlin.Function1){}[0] -final inline fun (kotlin/ByteArray).org.kotlincrypto.bitops.endian.internal/packBEInt(kotlin/Int, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian.internal/packBEInt|packBEInt@kotlin.ByteArray(kotlin.Int;kotlin.Int){}[0] -final inline fun (kotlin/ByteArray).org.kotlincrypto.bitops.endian.internal/packBELong(kotlin/Long, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian.internal/packBELong|packBELong@kotlin.ByteArray(kotlin.Long;kotlin.Int){}[0] -final inline fun (kotlin/ByteArray).org.kotlincrypto.bitops.endian.internal/packBEShort(kotlin/Short, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian.internal/packBEShort|packBEShort@kotlin.ByteArray(kotlin.Short;kotlin.Int){}[0] -final inline fun (kotlin/ByteArray).org.kotlincrypto.bitops.endian.internal/packLEInt(kotlin/Int, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian.internal/packLEInt|packLEInt@kotlin.ByteArray(kotlin.Int;kotlin.Int){}[0] -final inline fun (kotlin/ByteArray).org.kotlincrypto.bitops.endian.internal/packLELong(kotlin/Long, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian.internal/packLELong|packLELong@kotlin.ByteArray(kotlin.Long;kotlin.Int){}[0] -final inline fun (kotlin/ByteArray).org.kotlincrypto.bitops.endian.internal/packLEShort(kotlin/Short, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian.internal/packLEShort|packLEShort@kotlin.ByteArray(kotlin.Short;kotlin.Int){}[0] -final inline fun (kotlin/ByteArray).org.kotlincrypto.bitops.endian.internal/packPartial(kotlin/Int, kotlin/Int, kotlin/Int, kotlin/Function1): kotlin/ByteArray // org.kotlincrypto.bitops.endian.internal/packPartial|packPartial@kotlin.ByteArray(kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Function1){}[0] -final inline fun (org.kotlincrypto.bitops.endian.internal/B0).org.kotlincrypto.bitops.endian.internal/toBEInt(kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Int // org.kotlincrypto.bitops.endian.internal/toBEInt|toBEInt@org.kotlincrypto.bitops.endian.internal.B0(kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian.internal/B0).org.kotlincrypto.bitops.endian.internal/toBELong(kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Long // org.kotlincrypto.bitops.endian.internal/toBELong|toBELong@org.kotlincrypto.bitops.endian.internal.B0(kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian.internal/B0).org.kotlincrypto.bitops.endian.internal/toBEShort(kotlin/Byte): kotlin/Short // org.kotlincrypto.bitops.endian.internal/toBEShort|toBEShort@org.kotlincrypto.bitops.endian.internal.B0(kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian.internal/B0).org.kotlincrypto.bitops.endian.internal/toLEInt(kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Int // org.kotlincrypto.bitops.endian.internal/toLEInt|toLEInt@org.kotlincrypto.bitops.endian.internal.B0(kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian.internal/B0).org.kotlincrypto.bitops.endian.internal/toLELong(kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Long // org.kotlincrypto.bitops.endian.internal/toLELong|toLELong@org.kotlincrypto.bitops.endian.internal.B0(kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian.internal/B0).org.kotlincrypto.bitops.endian.internal/toLEShort(kotlin/Byte): kotlin/Short // org.kotlincrypto.bitops.endian.internal/toLEShort|toLEShort@org.kotlincrypto.bitops.endian.internal.B0(kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian.internal/Lo).org.kotlincrypto.bitops.endian.internal/toLong(kotlin/Int): kotlin/Long // org.kotlincrypto.bitops.endian.internal/toLong|toLong@org.kotlincrypto.bitops.endian.internal.Lo(kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlineIntFrom(kotlin/ByteArray, kotlin/Int): kotlin/Int // org.kotlincrypto.bitops.endian/beInlineIntFrom|beInlineIntFrom@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlineIntOf(kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Int // org.kotlincrypto.bitops.endian/beInlineIntOf|beInlineIntOf@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlineLongFrom(kotlin/ByteArray, kotlin/Int): kotlin/Long // org.kotlincrypto.bitops.endian/beInlineLongFrom|beInlineLongFrom@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlineLongOf(kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Long // org.kotlincrypto.bitops.endian/beInlineLongOf|beInlineLongOf@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlinePackUnsafe(kotlin/Int, kotlin/ByteArray, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian/beInlinePackUnsafe|beInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Int;kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlinePackUnsafe(kotlin/Int, kotlin/ByteArray, kotlin/Int, kotlin/Int, kotlin/Int =...): kotlin/ByteArray // org.kotlincrypto.bitops.endian/beInlinePackUnsafe|beInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Int;kotlin.ByteArray;kotlin.Int;kotlin.Int;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlinePackUnsafe(kotlin/Long, kotlin/ByteArray, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian/beInlinePackUnsafe|beInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Long;kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlinePackUnsafe(kotlin/Long, kotlin/ByteArray, kotlin/Int, kotlin/Int, kotlin/Int =...): kotlin/ByteArray // org.kotlincrypto.bitops.endian/beInlinePackUnsafe|beInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Long;kotlin.ByteArray;kotlin.Int;kotlin.Int;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlinePackUnsafe(kotlin/Short, kotlin/ByteArray, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian/beInlinePackUnsafe|beInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Short;kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlinePackUnsafe(kotlin/Short, kotlin/ByteArray, kotlin/Int, kotlin/Int, kotlin/Int =...): kotlin/ByteArray // org.kotlincrypto.bitops.endian/beInlinePackUnsafe|beInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Short;kotlin.ByteArray;kotlin.Int;kotlin.Int;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlineShortFrom(kotlin/ByteArray, kotlin/Int): kotlin/Short // org.kotlincrypto.bitops.endian/beInlineShortFrom|beInlineShortFrom@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/beInlineShortOf(kotlin/Byte, kotlin/Byte): kotlin/Short // org.kotlincrypto.bitops.endian/beInlineShortOf|beInlineShortOf@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlineIntFrom(kotlin/ByteArray, kotlin/Int): kotlin/Int // org.kotlincrypto.bitops.endian/leInlineIntFrom|leInlineIntFrom@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlineIntOf(kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Int // org.kotlincrypto.bitops.endian/leInlineIntOf|leInlineIntOf@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlineLongFrom(kotlin/ByteArray, kotlin/Int): kotlin/Long // org.kotlincrypto.bitops.endian/leInlineLongFrom|leInlineLongFrom@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlineLongOf(kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte, kotlin/Byte): kotlin/Long // org.kotlincrypto.bitops.endian/leInlineLongOf|leInlineLongOf@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlinePackUnsafe(kotlin/Int, kotlin/ByteArray, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian/leInlinePackUnsafe|leInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Int;kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlinePackUnsafe(kotlin/Int, kotlin/ByteArray, kotlin/Int, kotlin/Int, kotlin/Int =...): kotlin/ByteArray // org.kotlincrypto.bitops.endian/leInlinePackUnsafe|leInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Int;kotlin.ByteArray;kotlin.Int;kotlin.Int;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlinePackUnsafe(kotlin/Long, kotlin/ByteArray, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian/leInlinePackUnsafe|leInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Long;kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlinePackUnsafe(kotlin/Long, kotlin/ByteArray, kotlin/Int, kotlin/Int, kotlin/Int =...): kotlin/ByteArray // org.kotlincrypto.bitops.endian/leInlinePackUnsafe|leInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Long;kotlin.ByteArray;kotlin.Int;kotlin.Int;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlinePackUnsafe(kotlin/Short, kotlin/ByteArray, kotlin/Int): kotlin/ByteArray // org.kotlincrypto.bitops.endian/leInlinePackUnsafe|leInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Short;kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlinePackUnsafe(kotlin/Short, kotlin/ByteArray, kotlin/Int, kotlin/Int, kotlin/Int =...): kotlin/ByteArray // org.kotlincrypto.bitops.endian/leInlinePackUnsafe|leInlinePackUnsafe@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Short;kotlin.ByteArray;kotlin.Int;kotlin.Int;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlineShortFrom(kotlin/ByteArray, kotlin/Int): kotlin/Short // org.kotlincrypto.bitops.endian/leInlineShortFrom|leInlineShortFrom@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.ByteArray;kotlin.Int){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/leInlineShortOf(kotlin/Byte, kotlin/Byte): kotlin/Short // org.kotlincrypto.bitops.endian/leInlineShortOf|leInlineShortOf@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Byte;kotlin.Byte){}[0] -final inline fun (org.kotlincrypto.bitops.endian/Endian.Companion).org.kotlincrypto.bitops.endian/longOf(kotlin/Int, kotlin/Int): kotlin/Long // org.kotlincrypto.bitops.endian/longOf|longOf@org.kotlincrypto.bitops.endian.Endian.Companion(kotlin.Int;kotlin.Int){}[0] diff --git a/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/-EndianInline.kt b/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/-EndianInline.kt deleted file mode 100644 index 9b3abfb..0000000 --- a/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/-EndianInline.kt +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Copyright (c) 2025 Matthew Nelson - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -@file:Suppress("KotlinRedundantDiagnosticSuppress", "NOTHING_TO_INLINE", "DeprecatedCallableAddReplaceWith") - -package org.kotlincrypto.bitops.endian - -import org.kotlincrypto.bitops.endian.internal.* - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.longOf( - lo: Int, - hi: Int, -): Long = Lo(lo).toLong(hi = hi) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlineShortOf( - b0: Byte, - b1: Byte, -): Short = B0(b0).toBEShort(b1) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlineIntOf( - b0: Byte, - b1: Byte, - b2: Byte, - b3: Byte, -): Int = B0(b0).toBEInt(b1, b2, b3) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlineLongOf( - b0: Byte, - b1: Byte, - b2: Byte, - b3: Byte, - b4: Byte, - b5: Byte, - b6: Byte, - b7: Byte, -): Long = B0(b0).toBELong(b1, b2, b3, b4, b5, b6, b7) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlineShortOf( - b0: Byte, - b1: Byte, -): Short = B0(b0).toLEShort(b1) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlineIntOf( - b0: Byte, - b1: Byte, - b2: Byte, - b3: Byte, -): Int = B0(b0).toLEInt(b1, b2, b3) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlineLongOf( - b0: Byte, - b1: Byte, - b2: Byte, - b3: Byte, - b4: Byte, - b5: Byte, - b6: Byte, - b7: Byte, -): Long = B0(b0).toLELong(b1, b2, b3, b4, b5, b6, b7) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlineShortFrom( - source: ByteArray, - offset: Int, -): Short = B0(source[offset]).toBEShort( - source[offset + 1], -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlineIntFrom( - source: ByteArray, - offset: Int, -): Int = B0(source[offset]).toBEInt( - source[offset + 1], - source[offset + 2], - source[offset + 3], -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlineLongFrom( - source: ByteArray, - offset: Int, -): Long = B0(source[offset]).toBELong( - source[offset + 1], - source[offset + 2], - source[offset + 3], - source[offset + 4], - source[offset + 5], - source[offset + 6], - source[offset + 7], -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlineShortFrom( - source: ByteArray, - offset: Int, -): Short = B0(source[offset]).toLEShort( - source[offset + 1], -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlineIntFrom( - source: ByteArray, - offset: Int, -): Int = B0(source[offset]).toLEInt( - source[offset + 1], - source[offset + 2], - source[offset + 3], -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlineLongFrom( - source: ByteArray, - offset: Int, -): Long = B0(source[offset]).toLELong( - source[offset + 1], - source[offset + 2], - source[offset + 3], - source[offset + 4], - source[offset + 5], - source[offset + 6], - source[offset + 7], -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlinePackUnsafe( - target: Short, - dest: ByteArray, - destOffset: Int, -): ByteArray = dest.packBEShort(target, destOffset) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlinePackUnsafe( - target: Int, - dest: ByteArray, - destOffset: Int, -): ByteArray = dest.packBEInt(target, destOffset) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlinePackUnsafe( - target: Long, - dest: ByteArray, - destOffset: Int, -): ByteArray = dest.packBELong(target, destOffset) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlinePackUnsafe( - target: Short, - dest: ByteArray, - destOffset: Int, -): ByteArray = dest.packLEShort(target, destOffset) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlinePackUnsafe( - target: Int, - dest: ByteArray, - destOffset: Int, -): ByteArray = dest.packLEInt(target, destOffset) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlinePackUnsafe( - target: Long, - dest: ByteArray, - destOffset: Int, -): ByteArray = dest.packLELong(target, destOffset) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlinePackUnsafe( - target: Short, - dest: ByteArray, - destOffset: Int, - startIndex: Int, - endIndex: Int = Short.SIZE_BYTES, -): ByteArray = dest.packAllElsePartial( - offset = destOffset, - startIndex = startIndex, - endIndex = endIndex, - sizeBytes = Short.SIZE_BYTES, - packAll = { packBEShort(target, destOffset) }, - ushr = { bits -> (target.toInt() ushr (8 - bits)).toByte() }, -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlinePackUnsafe( - target: Int, - dest: ByteArray, - destOffset: Int, - startIndex: Int, - endIndex: Int = Int.SIZE_BYTES, -): ByteArray = dest.packAllElsePartial( - offset = destOffset, - startIndex = startIndex, - endIndex = endIndex, - sizeBytes = Int.SIZE_BYTES, - packAll = { packBEInt(target, destOffset) }, - ushr = { bits -> (target ushr (24 - bits)).toByte() }, -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.beInlinePackUnsafe( - target: Long, - dest: ByteArray, - destOffset: Int, - startIndex: Int, - endIndex: Int = Long.SIZE_BYTES, -): ByteArray = dest.packAllElsePartial( - offset = destOffset, - startIndex = startIndex, - endIndex = endIndex, - sizeBytes = Long.SIZE_BYTES, - packAll = { packBELong(target, destOffset) }, - ushr = { bits -> (target ushr (56 - bits)).toByte() }, -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlinePackUnsafe( - target: Short, - dest: ByteArray, - destOffset: Int, - startIndex: Int, - endIndex: Int = Short.SIZE_BYTES, -): ByteArray = dest.packAllElsePartial( - offset = destOffset, - startIndex = startIndex, - endIndex = endIndex, - sizeBytes = Short.SIZE_BYTES, - packAll = { packLEShort(target, destOffset) }, - ushr = { bits -> (target.toInt() ushr bits).toByte() }, -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlinePackUnsafe( - target: Int, - dest: ByteArray, - destOffset: Int, - startIndex: Int, - endIndex: Int = Int.SIZE_BYTES, -): ByteArray = dest.packAllElsePartial( - offset = destOffset, - startIndex = startIndex, - endIndex = endIndex, - sizeBytes = Int.SIZE_BYTES, - packAll = { packLEInt(target, destOffset) }, - ushr = { bits -> (target ushr bits).toByte() }, -) - -/** @suppress */ -@InternalEndianApi -@Deprecated("Not meant for public consumption", level = DeprecationLevel.ERROR) -public inline fun Endian.Companion.leInlinePackUnsafe( - target: Long, - dest: ByteArray, - destOffset: Int, - startIndex: Int, - endIndex: Int = Long.SIZE_BYTES, -): ByteArray = dest.packAllElsePartial( - offset = destOffset, - startIndex = startIndex, - endIndex = endIndex, - sizeBytes = Long.SIZE_BYTES, - packAll = { packLELong(target, destOffset) }, - ushr = { bits -> (target ushr bits).toByte() }, -) diff --git a/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/Endian.kt b/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/Endian.kt index bb74020..4e1da67 100644 --- a/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/Endian.kt +++ b/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/Endian.kt @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ -@file:Suppress("KotlinRedundantDiagnosticSuppress", "NOTHING_TO_INLINE", "DEPRECATION_ERROR", "RemoveRedundantQualifierName") -@file:OptIn(InternalEndianApi::class) +@file:Suppress("KotlinRedundantDiagnosticSuppress", "NOTHING_TO_INLINE", "RemoveRedundantQualifierName") package org.kotlincrypto.bitops.endian +import org.kotlincrypto.bitops.endian.internal.* import kotlin.jvm.JvmStatic /** @@ -1041,14 +1041,14 @@ public sealed class Endian private constructor() { public override fun shortOf( b0: Byte, b1: Byte, - ): Short = beInlineShortOf(b0, b1) + ): Short = B0(b0).toBEShort(b1) public override fun intOf( b0: Byte, b1: Byte, b2: Byte, b3: Byte, - ): Int = beInlineIntOf(b0, b1, b2, b3) + ): Int = B0(b0).toBEInt(b1, b2, b3) public override fun longOf( b0: Byte, @@ -1059,40 +1059,54 @@ public sealed class Endian private constructor() { b5: Byte, b6: Byte, b7: Byte, - ): Long = beInlineLongOf(b0, b1, b2, b3, b4, b5, b6, b7) + ): Long = B0(b0).toBELong(b1, b2, b3, b4, b5, b6, b7) public override fun shortFrom( source: ByteArray, offset: Int, - ): Short = beInlineShortFrom(source, offset) + ): Short = B0(source[offset]).toBEShort( + source[offset + 1], + ) public override fun intFrom( source: ByteArray, offset: Int, - ): Int = beInlineIntFrom(source, offset) + ): Int = B0(source[offset]).toBEInt( + source[offset + 1], + source[offset + 2], + source[offset + 3], + ) public override fun longFrom( source: ByteArray, offset: Int - ): Long = beInlineLongFrom(source, offset) + ): Long = B0(source[offset]).toBELong( + source[offset + 1], + source[offset + 2], + source[offset + 3], + source[offset + 4], + source[offset + 5], + source[offset + 6], + source[offset + 7], + ) public override fun packUnsafe( target: Short, dest: ByteArray, destOffset: Int, - ): ByteArray = beInlinePackUnsafe(target, dest, destOffset) + ): ByteArray = dest.packBEShort(target, destOffset) public override fun packUnsafe( target: Int, dest: ByteArray, destOffset: Int, - ): ByteArray = beInlinePackUnsafe(target, dest, destOffset) + ): ByteArray = dest.packBEInt(target, destOffset) public override fun packUnsafe( target: Long, dest: ByteArray, destOffset: Int, - ): ByteArray = beInlinePackUnsafe(target, dest, destOffset) + ): ByteArray = dest.packBELong(target, destOffset) public override fun packUnsafe( target: Short, @@ -1100,12 +1114,13 @@ public sealed class Endian private constructor() { destOffset: Int, startIndex: Int, endIndex: Int, // = Short.SIZE_BYTES - ): ByteArray = beInlinePackUnsafe( - target = target, - dest = dest, - destOffset = destOffset, + ): ByteArray = dest.packAllElsePartial( + offset = destOffset, startIndex = startIndex, endIndex = endIndex, + sizeBytes = Short.SIZE_BYTES, + packAll = { packBEShort(target, destOffset) }, + ushr = { bits -> (target.toInt() ushr (8 - bits)).toByte() }, ) public override fun packUnsafe( @@ -1114,12 +1129,13 @@ public sealed class Endian private constructor() { destOffset: Int, startIndex: Int, endIndex: Int, // = Int.SIZE_BYTES - ): ByteArray = beInlinePackUnsafe( - target = target, - dest = dest, - destOffset = destOffset, + ): ByteArray = dest.packAllElsePartial( + offset = destOffset, startIndex = startIndex, endIndex = endIndex, + sizeBytes = Int.SIZE_BYTES, + packAll = { packBEInt(target, destOffset) }, + ushr = { bits -> (target ushr (24 - bits)).toByte() }, ) public override fun packUnsafe( @@ -1128,12 +1144,13 @@ public sealed class Endian private constructor() { destOffset: Int, startIndex: Int, endIndex: Int, // = Long.SIZE_BYTES - ): ByteArray = beInlinePackUnsafe( - target = target, - dest = dest, - destOffset = destOffset, + ): ByteArray = dest.packAllElsePartial( + offset = destOffset, startIndex = startIndex, endIndex = endIndex, + sizeBytes = Long.SIZE_BYTES, + packAll = { packBELong(target, destOffset) }, + ushr = { bits -> (target ushr (56 - bits)).toByte() }, ) } @@ -1262,14 +1279,14 @@ public sealed class Endian private constructor() { public override fun shortOf( b0: Byte, b1: Byte, - ): Short = leInlineShortOf(b0, b1) + ): Short = B0(b0).toLEShort(b1) public override fun intOf( b0: Byte, b1: Byte, b2: Byte, b3: Byte, - ): Int = leInlineIntOf(b0, b1, b2, b3) + ): Int = B0(b0).toLEInt(b1, b2, b3) public override fun longOf( b0: Byte, @@ -1280,40 +1297,54 @@ public sealed class Endian private constructor() { b5: Byte, b6: Byte, b7: Byte, - ): Long = leInlineLongOf(b0, b1, b2, b3, b4, b5, b6, b7) + ): Long = B0(b0).toLELong(b1, b2, b3, b4, b5, b6, b7) public override fun shortFrom( source: ByteArray, offset: Int, - ): Short = leInlineShortFrom(source, offset) + ): Short = B0(source[offset]).toLEShort( + source[offset + 1], + ) public override fun intFrom( source: ByteArray, offset: Int, - ): Int = leInlineIntFrom(source, offset) + ): Int = B0(source[offset]).toLEInt( + source[offset + 1], + source[offset + 2], + source[offset + 3], + ) public override fun longFrom( source: ByteArray, offset: Int - ): Long = leInlineLongFrom(source, offset) + ): Long = B0(source[offset]).toLELong( + source[offset + 1], + source[offset + 2], + source[offset + 3], + source[offset + 4], + source[offset + 5], + source[offset + 6], + source[offset + 7], + ) public override fun packUnsafe( target: Short, dest: ByteArray, destOffset: Int, - ): ByteArray = leInlinePackUnsafe(target, dest, destOffset) + ): ByteArray = dest.packLEShort(target, destOffset) public override fun packUnsafe( target: Int, dest: ByteArray, destOffset: Int, - ): ByteArray = leInlinePackUnsafe(target, dest, destOffset) + ): ByteArray = dest.packLEInt(target, destOffset) public override fun packUnsafe( target: Long, dest: ByteArray, destOffset: Int, - ): ByteArray = leInlinePackUnsafe(target, dest, destOffset) + ): ByteArray = dest.packLELong(target, destOffset) public override fun packUnsafe( target: Short, @@ -1321,12 +1352,13 @@ public sealed class Endian private constructor() { destOffset: Int, startIndex: Int, endIndex: Int, // = Short.SIZE_BYTES - ): ByteArray = leInlinePackUnsafe( - target = target, - dest = dest, - destOffset = destOffset, + ): ByteArray = dest.packAllElsePartial( + offset = destOffset, startIndex = startIndex, endIndex = endIndex, + sizeBytes = Short.SIZE_BYTES, + packAll = { packLEShort(target, destOffset) }, + ushr = { bits -> (target.toInt() ushr bits).toByte() }, ) public override fun packUnsafe( @@ -1335,12 +1367,13 @@ public sealed class Endian private constructor() { destOffset: Int, startIndex: Int, endIndex: Int, // = Int.SIZE_BYTES - ): ByteArray = leInlinePackUnsafe( - target = target, - dest = dest, - destOffset = destOffset, + ): ByteArray = dest.packAllElsePartial( + offset = destOffset, startIndex = startIndex, endIndex = endIndex, + sizeBytes = Int.SIZE_BYTES, + packAll = { packLEInt(target, destOffset) }, + ushr = { bits -> (target ushr bits).toByte() }, ) public override fun packUnsafe( @@ -1349,12 +1382,13 @@ public sealed class Endian private constructor() { destOffset: Int, startIndex: Int, endIndex: Int, // = Long.SIZE_BYTES - ): ByteArray = leInlinePackUnsafe( - target = target, - dest = dest, - destOffset = destOffset, + ): ByteArray = dest.packAllElsePartial( + offset = destOffset, startIndex = startIndex, endIndex = endIndex, + sizeBytes = Long.SIZE_BYTES, + packAll = { packLELong(target, destOffset) }, + ushr = { bits -> (target ushr bits).toByte() }, ) } @@ -1364,8 +1398,7 @@ public sealed class Endian private constructor() { is Little -> "Endian.Little" } - /** @suppress */ - public companion object { + private companion object { @JvmStatic private fun checkPackParameters( diff --git a/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/InternalEndianApi.kt b/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/InternalEndianApi.kt deleted file mode 100644 index 41f4fc2..0000000 --- a/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/InternalEndianApi.kt +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025 Matthew Nelson - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ -package org.kotlincrypto.bitops.endian - -/** - * Denotes an api as internal, and subject to change at any time. - * - * Any usage of a declaration annotated with [InternalEndianApi] - * must be accepted by annotating that usage with the [OptIn] - * annotation, e.g. @OptIn(InternalEndianApi::class), or by using - * the following compiler argument: - * - * -Xopt-in=org.kotlincrypto.bitops.endian.InternalEndianApi - * */ -@RequiresOptIn -@MustBeDocumented -@Target( - AnnotationTarget.CLASS, - AnnotationTarget.ANNOTATION_CLASS, - AnnotationTarget.PROPERTY, - AnnotationTarget.FIELD, - AnnotationTarget.LOCAL_VARIABLE, - AnnotationTarget.VALUE_PARAMETER, - AnnotationTarget.CONSTRUCTOR, - AnnotationTarget.FUNCTION, - AnnotationTarget.PROPERTY_GETTER, - AnnotationTarget.PROPERTY_SETTER, - AnnotationTarget.TYPEALIAS -) -@Retention(AnnotationRetention.BINARY) -public annotation class InternalEndianApi diff --git a/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/internal/-EndianUtils.kt b/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/internal/-EndianUtils.kt index 637c35b..21b0519 100644 --- a/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/internal/-EndianUtils.kt +++ b/library/endian/src/commonMain/kotlin/org/kotlincrypto/bitops/endian/internal/-EndianUtils.kt @@ -20,20 +20,16 @@ package org.kotlincrypto.bitops.endian.internal import kotlin.jvm.JvmInline @JvmInline -@PublishedApi -internal value class B0 @PublishedApi internal constructor(@PublishedApi internal val b0: Byte) +internal value class B0 internal constructor(internal val b0: Byte) @JvmInline -@PublishedApi -internal value class Lo @PublishedApi internal constructor(@PublishedApi internal val lo: Int) +internal value class Lo internal constructor(internal val lo: Int) -@PublishedApi internal inline fun Lo.toLong(hi: Int): Long { return ((hi.toLong() and 0xffffffff) shl 32) or ((lo.toLong() and 0xffffffff) ) } -@PublishedApi internal inline fun B0.toBEShort(b1: Byte): Short { return ( ((b0.toInt() and 0xff) shl 8) or @@ -41,7 +37,6 @@ internal inline fun B0.toBEShort(b1: Byte): Short { ).toShort() } -@PublishedApi internal inline fun B0.toLEShort(b1: Byte): Short { return ( ((b0.toInt() and 0xff) ) or @@ -49,7 +44,6 @@ internal inline fun B0.toLEShort(b1: Byte): Short { ).toShort() } -@PublishedApi internal inline fun B0.toBEInt(b1: Byte, b2: Byte, b3: Byte): Int { return ((b0.toInt() ) shl 24) or ((b1.toInt() and 0xff) shl 16) or @@ -57,7 +51,6 @@ internal inline fun B0.toBEInt(b1: Byte, b2: Byte, b3: Byte): Int { ((b3.toInt() and 0xff) ) } -@PublishedApi internal inline fun B0.toLEInt(b1: Byte, b2: Byte, b3: Byte): Int { return ((b0.toInt() and 0xff) ) or ((b1.toInt() and 0xff) shl 8) or @@ -65,31 +58,26 @@ internal inline fun B0.toLEInt(b1: Byte, b2: Byte, b3: Byte): Int { ((b3.toInt() ) shl 24) } -@PublishedApi internal inline fun B0.toBELong(b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte, b6: Byte, b7: Byte): Long { return Lo(B0(b4).toBEInt(b5, b6, b7)).toLong(hi = this.toBEInt(b1, b2, b3)) } -@PublishedApi internal inline fun B0.toLELong(b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte, b6: Byte, b7: Byte): Long { return Lo(this.toLEInt(b1, b2, b3)).toLong(hi = B0(b4).toLEInt(b5, b6, b7)) } -@PublishedApi internal inline fun ByteArray.packBEShort(target: Short, offset: Int): ByteArray { this[offset ] = (target.toInt() ushr 8).toByte() this[offset + 1] = (target ).toByte() return this } -@PublishedApi internal inline fun ByteArray.packLEShort(target: Short, offset: Int): ByteArray { this[offset ] = (target ).toByte() this[offset + 1] = (target.toInt() ushr 8).toByte() return this } -@PublishedApi internal inline fun ByteArray.packBEInt(target: Int, offset: Int): ByteArray { this[offset ] = (target ushr 24).toByte() this[offset + 1] = (target ushr 16).toByte() @@ -98,7 +86,6 @@ internal inline fun ByteArray.packBEInt(target: Int, offset: Int): ByteArray { return this } -@PublishedApi internal inline fun ByteArray.packLEInt(target: Int, offset: Int): ByteArray { this[offset ] = (target ).toByte() this[offset + 1] = (target ushr 8).toByte() @@ -107,7 +94,6 @@ internal inline fun ByteArray.packLEInt(target: Int, offset: Int): ByteArray { return this } -@PublishedApi internal inline fun ByteArray.packBELong(target: Long, offset: Int): ByteArray { this[offset ] = (target ushr 56).toByte() this[offset + 1] = (target ushr 48).toByte() @@ -120,7 +106,6 @@ internal inline fun ByteArray.packBELong(target: Long, offset: Int): ByteArray { return this } -@PublishedApi internal inline fun ByteArray.packLELong(target: Long, offset: Int): ByteArray { this[offset ] = (target ).toByte() this[offset + 1] = (target ushr 8).toByte() @@ -133,7 +118,6 @@ internal inline fun ByteArray.packLELong(target: Long, offset: Int): ByteArray { return this } -@PublishedApi internal inline fun ByteArray.packAllElsePartial( offset: Int, startIndex: Int, @@ -147,7 +131,6 @@ internal inline fun ByteArray.packAllElsePartial( else packPartial(offset, startIndex, endIndex, ushr) } -@PublishedApi internal inline fun ByteArray.packPartial( offset: Int, startIndex: Int,