Package google.registry.util
Class SafeSerializationUtils
java.lang.Object
google.registry.util.SafeSerializationUtils
Helpers for using
SafeObjectInputStream
.
Please refer to SafeObjectInputStream
for more information.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Maximum number of elements allowed in a serialized collection. -
Method Summary
Modifier and TypeMethodDescriptionstatic Serializable
safeDeserialize
(byte[] bytes) Safely deserializes an object usingSafeObjectInputStream
.static <T> com.google.common.collect.ImmutableList
<T> safeDeserializeCollection
(Class<T> elementType, byte[] bytes) Safely deserializes a collection of objects previously serialized withserializeCollection(java.util.Collection<?>)
.static byte[]
serializeCollection
(Collection<?> collection) Serializes a collection of objects that can be safely deserialized usingsafeDeserializeCollection(java.lang.Class<T>, byte[])
.
-
Field Details
-
MAX_COLLECTION_SIZE
public static final int MAX_COLLECTION_SIZEMaximum number of elements allowed in a serialized collection.This value is sufficient for parameters embedded in a
URL
to typical cloud services. E.g., as of Fall 2023, AWS limits request line size to 16KB and GCP limits total header size to 64KB.- See Also:
-
-
Method Details
-
serializeCollection
Serializes a collection of objects that can be safely deserialized usingsafeDeserializeCollection(java.lang.Class<T>, byte[])
.If any element of the collection cannot be safely-deserialized, deserialization will fail.
-
safeDeserialize
Safely deserializes an object usingSafeObjectInputStream
. -
safeDeserializeCollection
public static <T> com.google.common.collect.ImmutableList<T> safeDeserializeCollection(Class<T> elementType, byte[] bytes) Safely deserializes a collection of objects previously serialized withserializeCollection(java.util.Collection<?>)
.
-