当前位置: 首页>>代码示例>>Java>>正文


Java FSTObjectInput类代码示例

本文整理汇总了Java中de.ruedigermoeller.serialization.FSTObjectInput的典型用法代码示例。如果您正苦于以下问题:Java FSTObjectInput类的具体用法?Java FSTObjectInput怎么用?Java FSTObjectInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FSTObjectInput类属于de.ruedigermoeller.serialization包,在下文中一共展示了FSTObjectInput类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: defst

import de.ruedigermoeller.serialization.FSTObjectInput; //导入依赖的package包/类
/**
 * fst 反序列化
 * 
 * byte[] -> object
 * 
 * @param inputStream
 * @return
 */
@SuppressWarnings("unchecked")
public static <T> T defst(InputStream inputStream) {
	T result = null;
	//
	AssertHelper.notNull(inputStream, "The InputStream must not be null");
	//
	FSTObjectInput in = null;
	try {
		in = fstConfiguration.getObjectInput(inputStream);
		result = (T) in.readObject();
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		// DON'T: in.close(); here prevents reuse and will result in an
		// exception
	}
	return result;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:27,代码来源:SerializeHelperWithoutPool.java

示例2: defstWithFactory

import de.ruedigermoeller.serialization.FSTObjectInput; //导入依赖的package包/类
/**
 * fst 反序列化
 * 
 * byte[] -> object
 * 
 * @param inputStream
 * @return
 */
@SuppressWarnings("unchecked")
public static <T> T defstWithFactory(InputStream inputStream) {
	AssertHelper.notNull(inputStream, "The InputStream must not be null");
	//
	T result = null;
	FSTObjectInput in = null;
	try {
		in = fstConfiguration.getObjectInput(inputStream);
		result = (T) in.readObject();
	} catch (Exception e) {
		LOGGER.error(new StringBuilder("Exception encountered during defstWithFactory()").toString(), e);
	} finally {
		// DON'T: in.close(); here prevents reuse and will result in an
		// exception
	}
	return result;
}
 
开发者ID:mixaceh,项目名称:openyu-commons,代码行数:26,代码来源:SerializeHelper.java

示例3: decode

import de.ruedigermoeller.serialization.FSTObjectInput; //导入依赖的package包/类
@Override
public Object decode(InputStream in, ClassResolver classResolver) throws Exception
{
	FSTObjectInput fin = conf.getObjectInput(in);
	Object result = fin.readObject();
	in.close();
    return result;
}
 
开发者ID:liulhdarks,项目名称:darks-grid,代码行数:9,代码来源:FSTCodec.java

示例4: deserialize

import de.ruedigermoeller.serialization.FSTObjectInput; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T> T deserialize(byte[] source, Class<T> clazz) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
    FSTObjectInput in = conf.getObjectInput(source, 0, source.length);
    try {
        return (T) in.readObject(clazz);
    } catch (Exception e) {
        throw new IOException("Cannot read object", e);
    }
}
 
开发者ID:bgranvea,项目名称:offheapstore-benchmark,代码行数:11,代码来源:DirectMemoryStore.java

示例5: getObjectInput

import de.ruedigermoeller.serialization.FSTObjectInput; //导入依赖的package包/类
public FSTObjectInput getObjectInput(InputStream inputStream) {
    return conf.getObjectInput(inputStream);
}
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:4,代码来源:FstFactory.java

示例6: deserialize

import de.ruedigermoeller.serialization.FSTObjectInput; //导入依赖的package包/类
/**
 * Factory method for creating an instance by reading it from an XML file.
 * <b>It will close the input stream when it's finished.</b>
 * @param is a stream to a file created by XMLEncoder.writeObject()
 * @return instance of serialized object, to be cast to a proper class by
 * receiver.
 * @throws java.io.IOException
 * @throws java.lang.ClassNotFoundException
 */
public static Object deserialize(InputStream is) throws IOException, ClassNotFoundException {
    FSTObjectInput in = conf.getObjectInput(is);
    Object obj = in.readObject();
    return obj;
}
 
开发者ID:chhh,项目名称:batmass,代码行数:15,代码来源:Serializer.java


注:本文中的de.ruedigermoeller.serialization.FSTObjectInput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。