/aosp_15_r20/external/kotlinx.serialization/formats/protobuf/commonTest/src/kotlinx/serialization/protobuf/ |
H A D | ProtobufAbsenceTest.kt | 6 import kotlinx.serialization.encodeToByteArray 46 val bytes = ProtoBuf.encodeToByteArray(DefaultValue(42)) in testDefaultValue() 55 val bytes = ProtoBuf.encodeToByteArray(NullableValue(null)) in testNullableValue() 64 …assertFailsWith(SerializationException::class) { ProtoBuf.encodeToByteArray(DefaultAndNullValue(nu… in testDefaultAndNullValue() 66 val bytes = ProtoBuf.encodeToByteArray(DefaultAndNullValue(42)) in testDefaultAndNullValue() 76 val bytes = ProtoBuf.encodeToByteArray(SimpleList(emptyList())) in testSimpleList() 85 val bytes = ProtoBuf.encodeToByteArray(DefaultList(listOf(42))) in testDefaultList() 94 … assertFailsWith(SerializationException::class) { ProtoBuf.encodeToByteArray(NullableList(null)) } in testNullableList() 96 val bytes = ProtoBuf.encodeToByteArray(NullableList(emptyList())) in testNullableList() 106 …assertFailsWith(SerializationException::class) { ProtoBuf.encodeToByteArray(DefaultNullableList(nu… in testDefaultNullableList() [all …]
|
H A D | ProtobufCollectionsTest.kt | 30 …assertFailsWith(SerializationException::class) { ProtoBuf.encodeToByteArray(NullableListElement(li… in testEncodeNullAsListElement() 35 …assertFailsWith(SerializationException::class) { ProtoBuf.encodeToByteArray(NullableMapKey(mapOf(n… in testEncodeNullAsMapKey() 40 val emptyListBytes = ProtoBuf.encodeToByteArray(ListWithNestedList(emptyList())) in testEmptyListIsNotListOfEmpty() 41 val listOfEmptyBytes = ProtoBuf.encodeToByteArray(ListWithNestedList(listOf(emptyList()))) in testEmptyListIsNotListOfEmpty() 51 val bytes = ProtoBuf.encodeToByteArray(map) in testEncodeMapWithNullableKey() 58 …assertFailsWith(SerializationException::class) { ProtoBuf.encodeToByteArray(NullableMapValue(mapOf… in testEncodeNullAsMapValue() 64 val bytes = ProtoBuf.encodeToByteArray(map) in testEncodeMapWithNullableValue() 72 val bytes = ProtoBuf.encodeToByteArray(ListWithNestedList(lists)) in testNestedList() 79 …assertFailsWith(SerializationException::class) { ProtoBuf.encodeToByteArray(ListWithNestedList(lis… in testNestedListIsNull() 85 val bytes = ProtoBuf.encodeToByteArray(ListWithNestedMap(list)) in testNestedMapInList() [all …]
|
H A D | ProtobufNullAndDefaultTest.kt | 23 assertEquals(0, proto.encodeToByteArray(ProtoWithNullDefault()).size) in testProtobufDropDefaults() 24 … assertFailsWith<SerializationException> { proto.encodeToByteArray(ProtoWithNullDefaultAlways()) } in testProtobufDropDefaults() 25 assertEquals(0, proto.encodeToByteArray(ProtoWithNullDefaultNever()).size) in testProtobufDropDefaults() 31 assertFailsWith<SerializationException> { proto.encodeToByteArray(ProtoWithNullDefault()) } in testProtobufEncodeDefaults() 32 … assertFailsWith<SerializationException> { proto.encodeToByteArray(ProtoWithNullDefaultAlways()) } in testProtobufEncodeDefaults() 33 assertEquals(0, proto.encodeToByteArray(ProtoWithNullDefaultNever()).size) in testProtobufEncodeDefaults()
|
H A D | ProtobufHugeClassTest.kt | 6 import kotlinx.serialization.encodeToByteArray 572 val bytes = ProtoBuf.encodeToByteArray(lists64) in testLists64() 581 val bytes = ProtoBuf.encodeToByteArray(values70) in testValues70() 590 val bytes = ProtoBuf.encodeToByteArray(values128) in testValues128() 599 val bytes = ProtoBuf.encodeToByteArray(values130) in testValues130()
|
H A D | AutoAssignIdsTest.kt | 20 val bytes = ProtoBuf.encodeToByteArray(WithoutIds.serializer(), w1) in saveAndRestoreWithoutIds() 28 val bytes = ProtoBuf.encodeToByteArray(WithoutIds.serializer(), w1) in incrementalIds()
|
/aosp_15_r20/external/kotlinx.serialization/formats/cbor/commonTest/src/kotlinx/serialization/cbor/ |
H A D | CborNumberEncodingTest.kt | 4 import kotlinx.serialization.encodeToByteArray 17 actual = Cbor.encodeToByteArray(number).size, in testEncodingLengthOfTinyNumbers() 30 actual = Cbor.encodeToByteArray(number).size, in testEncodingLengthOf8BitNumbers() 43 actual = Cbor.encodeToByteArray(number).size, in testEncodingLengthOf16BitNumbers() 56 actual = Cbor.encodeToByteArray(number).size, in testEncodingLengthOf32BitNumbers() 69 actual = Cbor.encodeToByteArray(number).size, in testEncodingLengthOfLargeNumbers() 79 actual = Cbor.encodeToByteArray(23).toList(), in testEncodingLargestPositiveTinyNumber() 96 actual = Cbor.encodeToByteArray(-24).toList(), in testEncodingLargestNegativeTinyNumber() 113 actual = Cbor.encodeToByteArray(255).toList(), in testEncodingLargestPositive8BitNumber() 131 actual = Cbor.encodeToByteArray(-256).toList(), in testEncodingLargestNegative8BitNumber() [all …]
|
/aosp_15_r20/frameworks/base/tests/AttestationVerificationTest/src/com/android/server/security/ |
H A D | AttestationVerificationPeerDeviceVerifierTest.kt | 70 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsSuccessTypeChallenge() 86 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsSuccessLocalPatchOlderThanOneYear() 122 challengeRequirements.putByteArray(PARAM_CHALLENGE, "activeUnlockValid".encodeToByteArray()) in verifyAttestation_returnsSuccessOwnedBySystem() 140 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsFailureOwnedBySystem() 157 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsFailurePatchDateNotWithinOneYearLocalPatch() 173 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsSuccessPatchDataWithinMaxPatchDiff() 190 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsFailurePatchDataNotWithinMaxPatchDiff() 207 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsFailureOwnedBySystemAndPatchDataNotWithinMaxPatchDiff() 226 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsFailureTrustedAnchorEmpty() 248 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in verifyAttestation_returnsFailureTrustedAnchorMismatch() [all …]
|
/aosp_15_r20/external/kotlinx.serialization/benchmark/src/jmh/kotlin/kotlinx/benchmarks/protobuf/ |
H A D | ProtoBaseline.kt | 26 private val holderBytes = ProtoBuf.encodeToByteArray(Holder.serializer(), holder) 29 …private val holderHolderExplicitBytes = ProtoBuf.encodeToByteArray(HolderExplicit.serializer(), ho… 32 fun toBytes() = ProtoBuf.encodeToByteArray(Holder.serializer(), holder) 38 fun toBytesExplicit() = ProtoBuf.encodeToByteArray(HolderExplicit.serializer(), holderExplicit)
|
H A D | ProtoListBenchmark.kt | 8 import kotlinx.serialization.protobuf.ProtoBuf.Default.encodeToByteArray 28 private val bytes = ProtoBuf.encodeToByteArray(value) 31 fun toBytes() = ProtoBuf.encodeToByteArray(HolderList.serializer(), value)
|
H A D | ProtoListLikeBenchmark.kt | 27 private val bytes = ProtoBuf.encodeToByteArray(value) 30 fun toBytes() = ProtoBuf.encodeToByteArray(HolderList.serializer(), value)
|
/aosp_15_r20/external/kotlinx.serialization/core/commonMain/src/kotlinx/serialization/ |
H A D | SerialFormat.kt | 66 public fun <T> encodeToByteArray(serializer: SerializationStrategy<T>, value: T): ByteArray in encodeToByteArray() method 138 InternalHexConverter.printHexBinary(encodeToByteArray(serializer, value), lowerCase = true) 185 public inline fun <reified T> BinaryFormat.encodeToByteArray(value: T): ByteArray = method 186 encodeToByteArray(serializersModule.serializer(), value)
|
/aosp_15_r20/external/flatbuffers/kotlin/flatbuffers-kotlin/src/commonMain/kotlin/com/google/flatbuffers/kotlin/ |
H A D | JSON.kt | 121 public fun parse(data: String): Reference = parse(ArrayReadBuffer(data.encodeToByteArray())) in parse() 688 this['\n'.toInt()] = "\\n".encodeToByteArray() in <lambda>() 689 this['\t'.toInt()] = "\\t".encodeToByteArray() in <lambda>() 690 this['\r'.toInt()] = "\\r".encodeToByteArray() in <lambda>() 691 this['\b'.toInt()] = "\\b".encodeToByteArray() in <lambda>() 692 this[0x0c] = "\\f".encodeToByteArray() in <lambda>() 693 this['"'.toInt()] = "\\\"".encodeToByteArray() in <lambda>() 694 this['\\'.toInt()] = "\\\\".encodeToByteArray() in <lambda>() 696 this[i] = "\\u${i.toPaddedHex()}".encodeToByteArray() in <lambda>()
|
/aosp_15_r20/external/okio/okio/src/commonTest/kotlin/okio/ |
H A D | ByteStringTest.kt | 503 val byteArray = "WwwwXxxxYyyyZzzz".encodeToByteArray() in copyInto() 510 val byteArray = "WwwwXxxxYyyyZzzz".encodeToByteArray() in copyIntoFullRange() 517 val byteArray = "WwwwXxxxYyyyZzzz".encodeToByteArray() in copyIntoWithTargetOffset() 524 val byteArray = "WwwwXxxxYyyyZzzz".encodeToByteArray() in copyIntoWithSourceOffset() 531 val byteArray = "WwwwXxxxYyyyZzzz".encodeToByteArray() in copyIntoWithAllParameters() 538 val byteArray = "WwwwXxxxYyyyZzzz".encodeToByteArray() in copyIntoBoundsChecks() 561 val byteArray = "WwwwXxxxYyyyZzzz".encodeToByteArray() in copyEmptyAtBounds() 572 val bytes = "Hello, World!".encodeToByteArray() in ofCopy() 581 val bytes = "Hello, World!".encodeToByteArray() in ofCopyRange()
|
/aosp_15_r20/external/cronet/third_party/protobuf/java/core/src/test/java/com/google/protobuf/ |
H A D | Utf8Test.java | 137 byte[] output = encodeToByteArray(message, expected.length, safeProcessor); in assertEncoding() 141 output = encodeToByteArray(message, expected.length, unsafeProcessor); in assertEncoding() 163 encodeToByteArray(message, length, safeProcessor); in assertEncoding_insufficientSpace() 173 encodeToByteArray(message, length, unsafeProcessor); in assertEncoding_insufficientSpace() 218 private static byte[] encodeToByteArray(String message, int length, Utf8.Processor processor) { in encodeToByteArray() method in Utf8Test
|
/aosp_15_r20/external/protobuf/java/core/src/test/java/com/google/protobuf/ |
H A D | Utf8Test.java | 137 byte[] output = encodeToByteArray(message, expected.length, safeProcessor); in assertEncoding() 141 output = encodeToByteArray(message, expected.length, unsafeProcessor); in assertEncoding() 163 encodeToByteArray(message, length, safeProcessor); in assertEncoding_insufficientSpace() 173 encodeToByteArray(message, length, unsafeProcessor); in assertEncoding_insufficientSpace() 218 private static byte[] encodeToByteArray(String message, int length, Utf8.Processor processor) { in encodeToByteArray() method in Utf8Test
|
/aosp_15_r20/frameworks/base/tests/AttestationVerificationTest/src/android/security/attestationverification/ |
H A D | PeerDeviceSystemAttestationVerificationTest.kt | 78 publicKeyRequirements.putByteArray(PARAM_PUBLIC_KEY, "publicKeyStr".encodeToByteArray()) in <lambda>() 88 challengeRequirements.putByteArray(PARAM_CHALLENGE, "challengeStr".encodeToByteArray()) in <lambda>() 102 wrongKeyRequirements.putByteArray("wrongReqKey", "publicKeyStr".encodeToByteArray()) in <lambda>() 116 requirements.putByteArray(PARAM_PUBLIC_KEY, "publicKeyStr".encodeToByteArray()) in <lambda>() 130 challengeRequirements.putByteArray(PARAM_CHALLENGE, "player456".encodeToByteArray()) in <lambda>()
|
H A D | SystemAttestationVerificationTest.kt | 104 "wrongBindingKey", "challengeStr".encodeToByteArray()) in <lambda>() 117 wrongChallengeRequirements.putByteArray(PARAM_CHALLENGE, "wrong".encodeToByteArray()) in <lambda>() 169 val challengeByteArray = challenge.encodeToByteArray() in <lambda>()
|
/aosp_15_r20/external/kotlinx.serialization/formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/conformance/ |
H A D | Proto3MessageTest.kt | 24 ProtoBuf.encodeToByteArray(this) in toProto() 35 ProtoBuf.encodeToByteArray(this) in toProto() 56 val bytes = ProtoBuf.encodeToByteArray(message) in default()
|
H A D | Proto3PackedTest.kt | 41 val bytes = ProtoBuf.encodeToByteArray(message) in default() 67 val bytes = ProtoBuf.encodeToByteArray(message) in signedAndFixed() 90 val bytes = ProtoBuf.encodeToByteArray(message) in unsigned()
|
H A D | Proto3RepeatedTest.kt | 63 val bytes = ProtoBuf.encodeToByteArray(message) in default() 98 val bytes = ProtoBuf.encodeToByteArray(message) in signedAndFixed() 124 val bytes = ProtoBuf.encodeToByteArray(message) in unsigned()
|
/aosp_15_r20/external/flatbuffers/kotlin/flatbuffers-kotlin/src/commonTest/kotlin/com/google/flatbuffers/kotlin/ |
H A D | JSONTest.kt | 29 val data = dataStr.encodeToByteArray() in parse2Test() 54 val data = dataStr.encodeToByteArray() in parseSample() 346 JSONParser().parse(ArrayReadBuffer(data.encodeToByteArray())) in testParseMustFail() 424 JSONParser().parse(ArrayReadBuffer(data.encodeToByteArray())) in testParseMustPass()
|
/aosp_15_r20/external/flatbuffers/kotlin/benchmark/src/jvmMain/kotlin/com/google/flatbuffers/kotlin/benchmark/ |
H A D | UTF8Benchmark.kt | 43 final var sampleSmallUtf8Decoded = sampleSmallUtf8.map { it.encodeToByteArray() }.toList() in <lambda>() 45 final var sampleSmallAsciiDecoded = sampleSmallAscii.map { it.encodeToByteArray() }.toList() in <lambda>() 54 blackhole.consume(i.encodeToByteArray()) in encodeUtf8KotlinStandard() 101 blackhole.consume(i.encodeToByteArray()) in encodeAsciiKotlinStandard()
|
/aosp_15_r20/external/kotlinx.serialization/formats/cbor/commonMain/src/kotlinx/serialization/cbor/internal/ |
H A D | Encoding.kt | 145 encodeByteArray(value.encodeToByteArray(), HEADER_STRING) in encodeString() 177 … in (UByte.MAX_VALUE.toUInt() + 1u)..UShort.MAX_VALUE.toUInt() -> encodeToByteArray(value, 2, 25) in encodeString() 178 in (UShort.MAX_VALUE.toUInt() + 1u)..UInt.MAX_VALUE -> encodeToByteArray(value, 4, 26) in encodeString() 179 else -> encodeToByteArray(value, 8, 27) in encodeString() 182 private fun encodeToByteArray(value: ULong, bytes: Int, tag: Byte): ByteArray { in encodeString() method in CborEncoder
|
/aosp_15_r20/external/kotlinx.serialization/formats/protobuf/jvmTest/src/kotlinx/serialization/protobuf/ |
H A D | ProtoBufNullTest.kt | 64 val parsed = TestData.MessageWithOptionals.parseFrom(protoBuf.encodeToByteArray(data)) in <lambda>() 81 val parsed = TestData.MessageWithOptionals.parseFrom(protoBuf.encodeToByteArray(data)) in <lambda>() 98 val parsed = TestData.MessageWithOptionals.parseFrom(protoBuf.encodeToByteArray(data)) in <lambda>()
|
/aosp_15_r20/external/kotlinx.serialization/formats/json-tests/jvmTest/src/kotlinx/serialization/features/ |
H A D | JsonLazySequenceTest.kt | 56 val ins = ByteArrayInputStream(inputStringWsSeparated.encodeToByteArray()) in <lambda>() 77 private fun String.asInputStream() = ByteArrayInputStream(this.encodeToByteArray()) in <lambda>() 110 val ins = ByteArrayInputStream(input.encodeToByteArray()) in <lambda>()
|