All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazon.ion.impl.bin.utf8.Utf8StringEncoderPool Maven / Gradle / Ivy

There is a newer version: 1.11.9
Show newest version
package com.amazon.ion.impl.bin.utf8;

/**
 * A thread-safe shared pool of {@link Utf8StringEncoder}s that can be used for UTF8 encoding.
 */
public class Utf8StringEncoderPool extends Pool {

    private static final Utf8StringEncoderPool INSTANCE = new Utf8StringEncoderPool();

    // Do not allow instantiation; all classes should share the singleton instance.
    private Utf8StringEncoderPool() {
        super(new Allocator() {
            @Override
            public Utf8StringEncoder newInstance(Pool pool) {
                return new Utf8StringEncoder(pool);
            }
        });
    }

    /**
     * @return a threadsafe shared instance of {@link Utf8StringEncoderPool}.
     */
    public static Utf8StringEncoderPool getInstance() {
        return INSTANCE;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy