public FSTClazzInfo(FSTConfiguration conf, Class clazz, FSTClazzInfoRegistry infoRegistry, boolean ignoreAnnotations) { this.conf = conf; // fixme: historically was not bound to conf but now is. Remove redundant state + refs (note: may still be useful because of less pointerchasing) crossPlatform = conf.isCrossPlatform(); this.clazz = clazz; enumConstants = clazz.getEnumConstants();
/** * Creates a FSTObjectInput that uses the specified * underlying InputStream. * * Don't create a FSTConfiguration with each stream, just create one global static configuration and reuseit. * FSTConfiguration is threadsafe. * * @param in the specified input stream */ public FSTObjectInput(InputStream in, FSTConfiguration conf) { setCodec(conf.createStreamDecoder()); getCodec().setInputStream(in); isCrossPlatform = conf.isCrossPlatform(); initRegistries(conf); this.conf = conf; }
public FSTClazzInfo(FSTConfiguration conf, Class clazz, FSTClazzInfoRegistry infoRegistry, boolean ignoreAnnotations) { this.conf = conf; // fixme: historically was not bound to conf but now is. Remove redundant state + refs (note: may still be useful because of less pointerchasing) crossPlatform = conf.isCrossPlatform(); this.clazz = clazz; enumConstants = clazz.getEnumConstants();
/** * Creates a FSTObjectInput that uses the specified * underlying InputStream. * * Don't create a FSTConfiguration with each stream, just create one global static configuration and reuseit. * FSTConfiguration is threadsafe. * * @param in the specified input stream */ public FSTObjectInput(InputStream in, FSTConfiguration conf) { setCodec(conf.createStreamDecoder()); getCodec().setInputStream(in); isCrossPlatform = conf.isCrossPlatform(); initRegistries(conf); this.conf = conf; }
/** * Creates a new FSTObjectOutput stream to write data to the specified * underlying output stream. The counter <code>written</code> is * set to zero. * Don't create a FSTConfiguration with each stream, just create one global static configuration and reuse it. * FSTConfiguration is threadsafe. * * @param out the underlying output stream, to be saved for later * use. */ public FSTObjectOutput(OutputStream out, FSTConfiguration conf) { this.conf = conf; setCodec(conf.createStreamEncoder()); getCodec().setOutstream(out); isCrossPlatform = conf.isCrossPlatform(); objects = (FSTObjectRegistry) conf.getCachedObject(FSTObjectRegistry.class); if ( objects == null ) { objects = new FSTObjectRegistry(conf); objects.disabled = !conf.isShareReferences(); } else { objects.clearForWrite(conf); } dontShare = objects.disabled; stringInfo = getClassInfoRegistry().getCLInfo(String.class, conf); }
/** * Creates a new FSTObjectOutput stream to write data to the specified * underlying output stream. The counter <code>written</code> is * set to zero. * Don't create a FSTConfiguration with each stream, just create one global static configuration and reuse it. * FSTConfiguration is threadsafe. * * @param out the underlying output stream, to be saved for later * use. */ public FSTObjectOutput(OutputStream out, FSTConfiguration conf) { this.conf = conf; setCodec(conf.createStreamEncoder()); getCodec().setOutstream(out); isCrossPlatform = conf.isCrossPlatform(); objects = (FSTObjectRegistry) conf.getCachedObject(FSTObjectRegistry.class); if ( objects == null ) { objects = new FSTObjectRegistry(conf); objects.disabled = !conf.isShareReferences(); } else { objects.clearForWrite(conf); } dontShare = objects.disabled; stringInfo = getClassInfoRegistry().getCLInfo(String.class, conf); }
private static FSTConfiguration copy(ClassLoader classLoader, FstCodec codec) { FSTConfiguration def = FSTConfiguration.createDefaultConfiguration(); def.setClassLoader(classLoader); def.setCoderSpecific(codec.config.getCoderSpecific()); def.setCrossPlatform(codec.config.isCrossPlatform()); def.setForceClzInit(codec.config.isForceClzInit()); def.setForceSerializable(codec.config.isForceSerializable()); def.setInstantiator(codec.config.getInstantiator(null)); def.setName(codec.config.getName()); def.setPreferSpeed(codec.config.isPreferSpeed()); def.setShareReferences(codec.config.isShareReferences()); def.setStreamCoderFactory(codec.config.getStreamCoderFactory()); def.setVerifier(codec.config.getVerifier()); return def; }
private static FSTConfiguration copy(ClassLoader classLoader, FstCodec codec) { FSTConfiguration def = FSTConfiguration.createDefaultConfiguration(); def.setClassLoader(classLoader); def.setCoderSpecific(codec.config.getCoderSpecific()); def.setCrossPlatform(codec.config.isCrossPlatform()); def.setForceClzInit(codec.config.isForceClzInit()); def.setForceSerializable(codec.config.isForceSerializable()); def.setInstantiator(codec.config.getInstantiator(null)); def.setName(codec.config.getName()); def.setPreferSpeed(codec.config.isPreferSpeed()); def.setShareReferences(codec.config.isShareReferences()); def.setStreamCoderFactory(codec.config.getStreamCoderFactory()); def.setVerifier(codec.config.getVerifier()); return def; }
private static FSTConfiguration copy(ClassLoader classLoader, FstCodec codec) { FSTConfiguration def = FSTConfiguration.createDefaultConfiguration(); def.setClassLoader(classLoader); def.setCoderSpecific(codec.config.getCoderSpecific()); def.setCrossPlatform(codec.config.isCrossPlatform()); def.setForceClzInit(codec.config.isForceClzInit()); def.setForceSerializable(codec.config.isForceSerializable()); def.setInstantiator(codec.config.getInstantiator(null)); def.setName(codec.config.getName()); def.setPreferSpeed(codec.config.isPreferSpeed()); def.setShareReferences(codec.config.isShareReferences()); def.setStreamCoderFactory(codec.config.getStreamCoderFactory()); def.setVerifier(codec.config.getVerifier()); return def; }