public static Serializer getSerializableSerializer()

in serialization/src/main/java/com/twitter/serial/serializer/CoreSerializers.java [521:539]


    public static <T extends Serializable> Serializer<T> getSerializableSerializer() {
        return new ObjectSerializer<T>() {
            @Override
            protected void serializeObject(@NotNull SerializationContext context,
                    @NotNull SerializerOutput output, @NotNull T object) throws IOException {
                //noinspection BlacklistedMethod
                output.writeByteArray(SerializableUtils.toByteArray(object));
            }

            @Nullable
            @Override
            protected T deserializeObject(@NotNull SerializationContext context,
                    @NotNull SerializerInput input, int versionNumber)
                    throws IOException, ClassNotFoundException {
                //noinspection BlacklistedMethod
                return SerializableUtils.fromByteArray(input.readByteArray());
            }
        };
    }