本文整理了Java中com.esotericsoftware.kryo.io.Output.getOutputStream()
方法的一些代码示例,展示了Output.getOutputStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Output.getOutputStream()
方法的具体详情如下:
包路径:com.esotericsoftware.kryo.io.Output
类名称:Output
方法名:getOutputStream
暂无
代码示例来源:origin: pbailis/ramp-sigmod2014-code
public void serialize(Object object) throws IOException {
kryo.writeClassAndObject(this.output, object);
this.output.flush();
this.output.getOutputStream().flush();
}
代码示例来源:origin: org.apache.apex/apex-engine
public void setOutputStream(@Nullable final OutputStream out) throws IOException
{
final Output output;
if (out != null) {
output = new Output(4096, -1)
{
@Override
public void flush() throws KryoException
{
super.flush();
// Kryo does not flush internal output stream during flush. We need to flush it explicitly.
try {
getOutputStream().flush();
} catch (IOException e) {
throw new KryoException(e);
}
}
};
output.setOutputStream(out);
} else {
output = null;
}
final Output oldOut = this.output.getAndSet(output);
if (oldOut != null && oldOut.getOutputStream() != out) {
synchronized (oldOut) {
oldOut.close();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!