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

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

The newest version!
package com.amazon.ion.impl.bin.utf8;

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

    private static final Utf8StringDecoderPool INSTANCE = new Utf8StringDecoderPool();

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy