- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 72 for GoBytes (0.16 sec)
-
platforms/core-runtime/serialization/src/testFixtures/groovy/org/gradle/internal/serialize/SerializerSpec.groovy
KryoBackedEncoder } Class<? extends AbstractDecoder> getDecoder() { KryoBackedDecoder } <T> T serialize(T value, Serializer<T> serializer) { def bytes = toBytes(value, serializer) return fromBytes(bytes, serializer) } /** * Serializes and deserializes the given value, asserting that the generated byte sequence is shorter than it would be when default
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Mon Apr 15 16:06:56 UTC 2024 - 2.3K bytes - Viewed (0) -
platforms/software/dependency-management/src/test/groovy/org/gradle/api/internal/artifacts/ivyservice/resolveengine/result/ComponentSelectionReasonSerializerTest.groovy
} def "multiple writes of the same custom reason"() { when: def single = toBytes(withReason("hello"), serializer) def withDuplicate = toBytes(withReasons("hello", "hello"), serializer) def withoutDuplicate = toBytes(withReasons("hello", "other"), serializer) then: single.length < withDuplicate.length withDuplicate.length < 2*single.length
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Tue Oct 10 21:10:11 UTC 2023 - 4.7K bytes - Viewed (0) -
platforms/core-runtime/logging/src/test/groovy/org/gradle/internal/logging/serializer/LogSerializerSpec.groovy
public <T> T serialize(T value, Serializer<T> serializer) { def bytes = toBytes(value, serializer) return fromBytes(bytes, serializer) } public <T> T fromBytes(byte[] bytes, Serializer<T> serializer) { return serializer.read(new KryoBackedDecoder(new ByteArrayInputStream(bytes))) } public <T> byte[] toBytes(T value, Serializer<T> serializer) { def bytes = new ByteArrayOutputStream()
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Fri Sep 22 09:05:18 UTC 2023 - 1.6K bytes - Viewed (0) -
internal/s3select/sql/value.go
return } // ToTimestamp returns the timestamp value if present. func (v Value) ToTimestamp() (t time.Time, ok bool) { t, ok = v.value.(time.Time) return } // ToBytes returns the value if byte-slice. func (v Value) ToBytes() (val []byte, ok bool) { val, ok = v.value.([]byte) return } // ToArray returns the value if it is a slice of values. func (v Value) ToArray() (val []Value, ok bool) {
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Fri Feb 25 20:31:19 UTC 2022 - 20.2K bytes - Viewed (0) -
platforms/core-runtime/messaging/src/test/groovy/org/gradle/internal/remote/internal/hub/JavaSerializationBackedMethodArgsSerializerTest.groovy
def "serializes an empty args array"() { expect: def arraySerializer = serializer.forTypes([] as Class[]) serialize([] as Object[], arraySerializer).length == 0 toBytes([] as Object[], arraySerializer).length == 0 } def "serializes single args"() { expect: def arraySerializer = serializer.forTypes([String,] as Class[])
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Fri Sep 22 08:59:22 UTC 2023 - 1.5K bytes - Viewed (0) -
platforms/software/dependency-management/src/test/groovy/org/gradle/api/internal/artifacts/ivyservice/resolveengine/result/ComponentSelectorSerializerTest.groovy
DefaultModuleIdentifier.newId('group3', 'name3'), constraint('1.0'), factory.of(attr, "val1"), []) when: byte[] result1 = toBytes(selector1, serializer) byte[] result2 = toBytes(selector2, serializer) byte[] result3 = toBytes(selector3, serializer) then: result2.length == result1.length // different attributes result3.length < result1.length // already seen
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Tue Oct 10 21:10:11 UTC 2023 - 11.8K bytes - Viewed (0) -
testing/internal-performance-testing/src/main/groovy/org/gradle/performance/results/PrettyCalculator.groovy
import org.gradle.performance.measure.DataAmount import org.gradle.performance.measure.Duration import java.math.RoundingMode @CompileStatic class PrettyCalculator { static String toBytes(Amount<DataAmount> bytes) { return bytes.toUnits(DataAmount.BYTES).value.setScale(3, RoundingMode.HALF_UP).stripTrailingZeros().toString() + " B" } static String toMillis(Amount<Duration> duration) {
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Apr 04 07:21:38 UTC 2024 - 1.6K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator.go
binary.BigEndian.PutUint32(b, uint32(length)) if _, err := w.Write(b); err != nil { panic(err) // Write() on hash never fails } } // toBytes performs unholy acts to avoid allocations func toBytes(s string) []byte { // unsafe.StringData is unspecified for the empty string, so we provide a strict interpretation if len(s) == 0 { return nil } // Copied from go 1.20.1 os.File.WriteString
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Jul 03 16:16:51 UTC 2023 - 9.8K bytes - Viewed (0) -
platforms/core-runtime/messaging/src/test/groovy/org/gradle/internal/remote/internal/hub/DefaultMethodArgsSerializerTest.groovy
def "serializes an empty args array"() { expect: def arraySerializer = serializer.forTypes([] as Class[]) serialize([] as Object[], arraySerializer).length == 0 toBytes([] as Object[], arraySerializer).length == 0 } def "serializes multiple args using the serializer registry that can serialize all types"() { given:
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Fri Sep 22 08:59:22 UTC 2023 - 2.2K bytes - Viewed (0) -
platforms/core-runtime/serialization/src/test/groovy/org/gradle/internal/serialize/BaseSerializerFactoryTest.groovy
} def "uses efficient serialization for Paths"() { expect: def serializer = factory.getSerializerFor(Path) def encoded = toBytes(Paths.get("some-file"), serializer) fromBytes(encoded, serializer) == Paths.get("some-file") encoded.length == 10 } def "uses efficient serialization for Long"() { expect:
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Mon Apr 15 16:06:56 UTC 2024 - 2.9K bytes - Viewed (0)