public FSTBytezEncoder(FSTConfiguration conf, BasicBytez base) { if ( FSTConfiguration.isAndroid ) throw new RuntimeException("not supported on android"); this.conf = conf; buffout = base; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if ( clnames == null ) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
public FSTStreamEncoder(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if ( clnames == null ) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
public FSTBytezDecoder(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if (clnames == null) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
public FSTStreamDecoder(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if (clnames == null) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
@Override public void setConf(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if (clnames == null) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
public FSTBytezEncoder(FSTConfiguration conf, BasicBytez base) { if ( FSTConfiguration.isAndroid ) throw new RuntimeException("not supported on android"); this.conf = conf; buffout = base; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if ( clnames == null ) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
@Override public void setConf(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if (clnames == null) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
public FSTStreamDecoder(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if (clnames == null) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
protected void initRegistries(FSTConfiguration conf) { ignoreAnnotations = conf.getCLInfoRegistry().isIgnoreAnnotations(); clInfoRegistry = conf.getCLInfoRegistry(); objects = (FSTObjectRegistry) conf.getCachedObject(FSTObjectRegistry.class); if (objects == null) { objects = new FSTObjectRegistry(conf); } else { objects.clearForRead(conf); } }
public FSTBytezDecoder(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if (clnames == null) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
public FSTStreamEncoder(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if ( clnames == null ) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
@Override public void setConf(FSTConfiguration conf) { this.conf = conf; clnames = (FSTClazzNameRegistry) conf.getCachedObject(FSTClazzNameRegistry.class); if ( clnames == null ) { clnames = new FSTClazzNameRegistry(conf.getClassRegistry()); } else { clnames.clear(); } }
/** * if output stream is null, just encode into a byte array * @param outstream */ @Override public void setOutstream(OutputStream outstream) { if ( buffout == null ) { // try reuse buffout = (FSTOutputStream) conf.getCachedObject(FSTOutputStream.class); if ( buffout == null ) // if fail, alloc buffout = new FSTOutputStream(1000, outstream); else buffout.reset(); // reset resued fstoutput } if ( outstream == null ) buffout.setOutstream(buffout); else buffout.setOutstream(outstream); }
protected void initRegistries(FSTConfiguration conf) { ignoreAnnotations = conf.getCLInfoRegistry().isIgnoreAnnotations(); clInfoRegistry = conf.getCLInfoRegistry(); objects = (FSTObjectRegistry) conf.getCachedObject(FSTObjectRegistry.class); if (objects == null) { objects = new FSTObjectRegistry(conf); } else { objects.clearForRead(conf); } }
/** * if output stream is null, just encode into a byte array * @param outstream */ @Override public void setOutstream(OutputStream outstream) { if ( buffout == null ) { // try reuse buffout = (FSTOutputStream) conf.getCachedObject(FSTOutputStream.class); if ( buffout == null ) // if fail, alloc buffout = new FSTOutputStream(1000, outstream); else buffout.reset(); // reset resued fstoutput } if ( outstream == null ) buffout.setOutstream(buffout); else buffout.setOutstream(outstream); }
/** * 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); }