/* (non-Javadoc)
@see com.abubusoft.kripton.AbstractContext#createSerializer(java.io.OutputStream, com.fasterxml.jackson.core.JsonEncoding)
176394
@Override
	public JacksonWrapperSerializer createSerializer(OutputStream out, JsonEncoding encoding) {
		try {
			JsonGenerator generator = innerFactory.createGenerator(out, encoding);
			// generator.setPrettyPrinter(new MinimalPrettyPrinter());
			return new JacksonWrapperSerializer(generator, getSupportedFormat());
		} catch (IOException e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
243679
public static <T> HashMultisetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new HashMultisetJsonDeserializer<T>( deserializer );
    }
1264320
public CacheConfigurationBuilder<K, V> withKeySerializer(Class<? extends Serializer<K>> keySerializerClass) {
    return withSerializer(new DefaultSerializerConfiguration<>(requireNonNull(keySerializerClass, "Null key serializer class"), DefaultSerializerConfiguration.Type.KEY));
  }
742814
public static byte[] serialize(Node inputNode) throws Exception
	{
		// Initialize sources and targets
		ByteArrayOutputStream serializerOutput = new ByteArrayOutputStream();
		Source sourceObject = new DOMSource(inputNode); 
		Result targetObject = new StreamResult(serializerOutput);
		
		// Create XML Transformer
		TransformerFactory serializerFactory = TransformerFactory.newInstance();
		Transformer serializer = serializerFactory.newTransformer();

		// Set output properties
		serializer.setOutputProperty(OutputKeys.INDENT, "yes");
		serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
		
		// Run serialization transformation
		serializer.transform(sourceObject, targetObject);
		
		// Return output as a byte array
		return serializerOutput.toByteArray();
	}
1345147
public static Marshaller createMarshaller() throws JAXBException {
		Marshaller marshaller = MessageUtilsHelper.getContext().createMarshaller();
		marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
		return marshaller;
	}
113157
public JsonReader createReader(InputStream input) {
        try {
            return createReader(new InputStreamReader(input, "UTF-8"));
        }
        catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    }
1290209
public static final <T> void addSerializer(SimpleModule module, Class<T> type,
			CheckedBiConsumer<T, JsonGenerator> consumer) {
		module.addSerializer(type, new JsonSerializer<T>() {

			@Override
			public final void serialize(T value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
				consumer.accept(value, gen);
			}

		});
	}
316365
public static Marshaller createMarshaller(Class clazz, String encoding) {
		try {
			JAXBContext jaxbContext = getJaxbContext(clazz);

			Marshaller marshaller = jaxbContext.createMarshaller();

			marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);

			if (StringUtils.isNotBlank(encoding)) {
				marshaller.setProperty(Marshaller.JAXB_ENCODING, encoding);
			}

			return marshaller;
		} catch (JAXBException e) {
			throw ExceptionUtil.unchecked(e);
		}
	}
557381
public static <T> MultisetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new MultisetJsonDeserializer<T>( deserializer );
    }
297605
public static <E extends Enum<E>> EnumMultisetJsonDeserializer<E> newInstance( EnumJsonDeserializer<E> deserializer ) {
        return new EnumMultisetJsonDeserializer<E>( deserializer );
    }
588060
private static <T> Map<Field, TypeSerializer<?>> buildNewFieldSerializersIndex(PojoSerializer<T> newPojoSerializer) {
		final Field[] newFields = newPojoSerializer.getFields();
		final TypeSerializer<?>[] newFieldSerializers = newPojoSerializer.getFieldSerializers();

		checkState(newFields.length == newFieldSerializers.length);

		int numFields = newFields.length;
		final Map<Field, TypeSerializer<?>> index = new HashMap<>(numFields);
		for (int i = 0; i < numFields; i++) {
			index.put(newFields[i], newFieldSerializers[i]);
		}

		return index;
	}
1212882
public CacheConfigurationBuilder<K, V> withKeySerializer(Serializer<K> keySerializer) {
    return withSerializer(new DefaultSerializerConfiguration<>(requireNonNull(keySerializer, "Null key serializer"), DefaultSerializerConfiguration.Type.KEY));
  }
948669
public static <T> SetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new SetJsonDeserializer<T>( deserializer );
    }
192124
protected Reader _createReader(InputStream in, JsonEncoding enc, IOContext ctxt) throws IOException
    {
        if (enc == null) {
            enc = JsonEncoding.UTF8;
        }
        // default to UTF-8 if encoding missing
        if (enc == JsonEncoding.UTF8) {
            boolean autoClose = ctxt.isResourceManaged() || isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE);
            return new UTF8Reader(in, autoClose);
        }
        return new InputStreamReader(in, enc.getJavaName());
    }
853941
public static <T> JsonCodec<T> create(Class<T> clazz) {
    return new JsonCodec<T>(clazz, DefaultGsonHolder.INSTANCE);
  }
807749
static <T> KryoSerializerSnapshotData<T> createFrom(
		Class<T> typeClass,
		LinkedHashMap<Class<?>, SerializableSerializer<?>> defaultKryoSerializers,
		LinkedHashMap<Class<?>, Class<? extends Serializer<?>>> defaultKryoSerializerClasses,
		LinkedHashMap<String, KryoRegistration> kryoRegistrations) {

		return new KryoSerializerSnapshotData<>(
			typeClass,
			optionalMapOf(defaultKryoSerializers, Class::getName),
			optionalMapOf(defaultKryoSerializerClasses, Class::getName),
			optionalMapOf(kryoRegistrations, Function.identity()));
	}
727391
public static <T> VectorJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new VectorJsonDeserializer<T>( deserializer );
    }