Home
last modified time | relevance | path

Searched refs:decodeFromByteArray (Results 1 – 25 of 250) sorted by relevance

12345678910

/aosp_15_r20/external/kotlinx.serialization/formats/protobuf/commonTest/src/kotlinx/serialization/protobuf/
H A DProtobufAbsenceTest.kt5 import kotlinx.serialization.decodeFromByteArray
41 …assertFailsWith(SerializationException::class) { ProtoBuf.decodeFromByteArray<SimpleValue>(ByteArr… in testSimpleValue()
49 val decoded = ProtoBuf.decodeFromByteArray<DefaultValue>(bytes) in testDefaultValue()
58 val decoded = ProtoBuf.decodeFromByteArray<NullableValue>(bytes) in testNullableValue()
69 val decoded = ProtoBuf.decodeFromByteArray<DefaultAndNullValue>(bytes) in testDefaultAndNullValue()
79 val decoded = ProtoBuf.decodeFromByteArray<SimpleList>(bytes) in testSimpleList()
88 val decoded = ProtoBuf.decodeFromByteArray<DefaultList>(bytes) in testDefaultList()
99 val decoded = ProtoBuf.decodeFromByteArray<NullableList>(bytes) in testNullableList()
111 val decoded = ProtoBuf.decodeFromByteArray<DefaultNullableList>(bytes) in testDefaultNullableList()
119 val decoded = ProtoBuf.decodeFromByteArray<SimpleMap>(bytes) in testSimpleMap()
[all …]
H A DProtobufCollectionsTest.kt42 val emptyList = ProtoBuf.decodeFromByteArray<ListWithNestedList>(emptyListBytes) in testEmptyListIsNotListOfEmpty()
43 val listOfEmpty = ProtoBuf.decodeFromByteArray<ListWithNestedList>(listOfEmptyBytes) in testEmptyListIsNotListOfEmpty()
52 val decoded = ProtoBuf.decodeFromByteArray<NullableMapKey>(bytes) in testEncodeMapWithNullableKey()
65 val decoded = ProtoBuf.decodeFromByteArray<NullableMapValue>(bytes) in testEncodeMapWithNullableValue()
73 val decoded = ProtoBuf.decodeFromByteArray<ListWithNestedList>(bytes) in testNestedList()
86 val decoded = ProtoBuf.decodeFromByteArray<ListWithNestedMap>(bytes) in testNestedMapInList()
94 val decoded = ProtoBuf.decodeFromByteArray<MapWithNullableNestedLists>(bytes) in testNestedListsInMap()
H A DProtobufEnumTest.kt34 assertFailsWith<SerializationException> { ProtoBuf.decodeFromByteArray<EnumHolder>(bytes) } in testUnknownValue()
36 assertFailsWith<SerializationException> { ProtoBuf.decodeFromByteArray<EnumHolder>(bytes) } in testUnknownValue()
52 assertFailsWith<SerializationException> { ProtoBuf.decodeFromByteArray<Holder>(bytes) } in testUnknownValueForAnnotatedEnum()
54 assertFailsWith<SerializationException> { ProtoBuf.decodeFromByteArray<Holder>(bytes) } in testUnknownValueForAnnotatedEnum()
H A DProtobufHugeClassTest.kt5 import kotlinx.serialization.decodeFromByteArray
575 val decoded = ProtoBuf.decodeFromByteArray<Lists64>(bytes) in testLists64()
584 val decoded = ProtoBuf.decodeFromByteArray<Values70>(bytes) in testValues70()
593 val decoded = ProtoBuf.decodeFromByteArray<Values128>(bytes) in testValues128()
602 val decoded = ProtoBuf.decodeFromByteArray<Values130>(bytes) in testValues130()
H A DAutoAssignIdsTest.kt21 val w2 = ProtoBuf.decodeFromByteArray(WithoutIds.serializer(), bytes) in saveAndRestoreWithoutIds()
29 val w2 = ProtoBuf.decodeFromByteArray(WithId.serializer(), bytes) in incrementalIds()
H A DProtobufMissingFieldsTest.kt19 val items = ProtoBuf.decodeFromByteArray(Items.serializer(), buffer) in testDeserializeAllFields()
31 val items = ProtoBuf.decodeFromByteArray(ItemsWithoutPageSize.serializer(), buffer) in testDeserializeSomeTagsAreNotInSchema()
H A DByteArraySerializerTest.kt50 assertEquals(obj, ProtoBuf.decodeFromByteArray(ByteArrayCarrier.serializer(), bytes)) in testWrappedByteArrayProtobuf()
/aosp_15_r20/external/kotlinx.serialization/formats/cbor/commonTest/src/kotlinx/serialization/cbor/
H A DCborNumberEncodingTest.kt3 import kotlinx.serialization.decodeFromByteArray
87 actual = Cbor.decodeFromByteArray(byteArrayOf(23)), in testDecodingLargestPositiveTinyNumber()
104 actual = Cbor.decodeFromByteArray(byteArrayOf(55)), in testDecodingLargestNegativeTinyNumber()
122 actual = Cbor.decodeFromByteArray(bytes), in testDecodingLargestPositive8BitNumber()
140 actual = Cbor.decodeFromByteArray(bytes), in testDecodingLargestNegative8BitNumber()
158 actual = Cbor.decodeFromByteArray(bytes), in testDecodingLargestPositive16BitNumber()
176 actual = Cbor.decodeFromByteArray(bytes), in testDecodingLargestNegative16BitNumber()
194 actual = Cbor.decodeFromByteArray(bytes), in testDecodingLargestPositive32BitNumber()
212 actual = Cbor.decodeFromByteArray(bytes), in testDecodingLargestNegative32BitNumber()
/aosp_15_r20/external/kotlinx.serialization/core/commonMain/src/kotlinx/serialization/
H A DSerialFormat.kt74 … public fun <T> decodeFromByteArray(deserializer: DeserializationStrategy<T>, bytes: ByteArray): T in encodeToByteArray() method
150 decodeFromByteArray(deserializer, InternalHexConverter.parseHexBinary(hex))
195 public inline fun <reified T> BinaryFormat.decodeFromByteArray(bytes: ByteArray): T = method
196 decodeFromByteArray(serializersModule.serializer(), bytes)
/aosp_15_r20/external/kotlinx.serialization/formats/cbor/jvmTest/src/kotlinx/serialization/cbor/
H A DCborCompatibilityTest.kt39 assertEquals(obj, Cbor.decodeFromByteArray(serializer, bytes)) in compare()
45 assertEquals(doubleWrapper, Cbor.decodeFromByteArray(DoubleData.serializer(), bytes)) in compareDouble()
51 assertEquals(floatWrapper, Cbor.decodeFromByteArray(FloatData.serializer(), bytes)) in compareFloat()
H A DCborStacktraceRecoveryTest.kt15 Cbor.decodeFromByteArray<String>(byteArrayOf(0xFF.toByte())) in <lambda>()
/aosp_15_r20/external/kotlinx.serialization/formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/conformance/
H A DProto3PackedTest.kt50 …val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Packed>(restored.toByteArray… in default()
77 …val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Packed>(restored.toByteArray… in signedAndFixed()
96 …val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Packed>(restored.toByteArray… in unsigned()
H A DProto3RepeatedTest.kt76 …val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Repeated>(restored.toByteArr… in default()
110 …val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Repeated>(restored.toByteArr… in signedAndFixed()
130 …val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Repeated>(restored.toByteArr… in unsigned()
H A DProto3UnpackedTest.kt54 …val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Unpacked>(restored.toByteArr… in default()
81 …val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Unpacked>(restored.toByteArr… in signedAndFixed()
H A DProto3MapTest.kt116 … val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Map>(restored.toByteArray()) in default()
151 … val restoredMessage = ProtoBuf.decodeFromByteArray<KTestMessagesProto3Map>(restored.toByteArray()) in signedAndFixed()
/aosp_15_r20/external/kotlinx.serialization/formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/
H A DProtoBufNullTest.kt115 val parsed = protoBuf.decodeFromByteArray<MessageWithOptionals>(data.toByteArray()) in <lambda>()
138 val parsed = protoBuf.decodeFromByteArray<MessageWithOptionals>(data.toByteArray()) in <lambda>()
161 val parsed = protoBuf.decodeFromByteArray<MessageWithOptionals>(data.toByteArray()) in <lambda>()
/aosp_15_r20/external/kotlinx.serialization/benchmark/src/jmh/kotlin/kotlinx/benchmarks/protobuf/
H A DProtoBaseline.kt35 fun fromBytes() = ProtoBuf.decodeFromByteArray(Holder.serializer(), holderBytes)
41 …fun fromBytesExplicit() = ProtoBuf.decodeFromByteArray(HolderExplicit.serializer(), holderHolderEx…
H A DProtoListLikeBenchmark.kt33 fun fromBytes() = ProtoBuf.decodeFromByteArray(HolderList.serializer(), bytes)
/aosp_15_r20/external/kotlinx.serialization/guide/example/
H A Dexample-formats-01.kt19 val obj = Cbor.decodeFromByteArray<Project>(bytes) in main()
H A Dexample-formats-04.kt19 val obj = ProtoBuf.decodeFromByteArray<Project>(bytes) in main()
H A Dexample-formats-05.kt24 val obj = ProtoBuf.decodeFromByteArray<Project>(bytes) in main()
H A Dexample-formats-03.kt23 val obj = Cbor.decodeFromByteArray<Data>(bytes) in main()
H A Dexample-formats-07.kt22 println(ProtoBuf.decodeFromByteArray<Data>(bytes)) in main()
/aosp_15_r20/external/kotlinx.serialization/formats/protobuf/commonTest/src/kotlinx/serialization/
H A DTestUtils.kt28 val restored = format.decodeFromByteArray(serializer, bytes) in assertSerializedToBinaryAndRestored()
/aosp_15_r20/external/kotlinx.serialization/formats/cbor/commonTest/src/kotlinx/serialization/
H A DTestUtilities.kt28 val restored = format.decodeFromByteArray(serializer, bytes) in assertSerializedToBinaryAndRestored()

12345678910