com.thoughtworks.xstream.XStream.createObjectInputStream()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(9.8k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中com.thoughtworks.xstream.XStream.createObjectInputStream()方法的一些代码示例,展示了XStream.createObjectInputStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XStream.createObjectInputStream()方法的具体详情如下:
包路径:com.thoughtworks.xstream.XStream
类名称:XStream
方法名:createObjectInputStream

XStream.createObjectInputStream介绍

[英]Creates an ObjectInputStream that deserializes a stream of objects from a reader using XStream.

It is necessary to call ObjectInputStream.close() when done, otherwise the stream might keep system resources.

Example

ObjectInputStream in = xstream.createObjectOutputStream(aReader); 
int a = out.readInt(); 
Object b = out.readObject(); 
Object c = out.readObject();

[中]创建ObjectInputStream,该流使用XStream对读取器中的对象流进行反序列化。
有必要调用ObjectInputStream。关闭(),否则流可能会保留系统资源。
####范例

ObjectInputStream in = xstream.createObjectOutputStream(aReader); 
int a = out.readInt(); 
Object b = out.readObject(); 
Object c = out.readObject();

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from a reader using XStream.
 * <p>
 * It is necessary to call ObjectInputStream.close() when done, otherwise the stream might keep system resources.
 * </p>
 * <h3>Example</h3>
 *
 * <pre>
 * ObjectInputStream in = xstream.createObjectOutputStream(aReader);
 * int a = out.readInt();
 * Object b = out.readObject();
 * Object c = out.readObject();
 * </pre>
 * 
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.0.3
 */
public ObjectInputStream createObjectInputStream(final HierarchicalStreamReader reader) throws IOException {
  return createObjectInputStream(reader, null);
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from an InputStream
 * using XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.3
 */
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(in));
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from a reader using
 * XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.0.3
 */
public ObjectInputStream createObjectInputStream(Reader xmlReader) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(xmlReader));
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

final ObjectInputStream configIn = outer.createObjectInputStream(reader);
try {
  final XStream configured = (XStream)configIn.readObject();
  final ObjectInputStream in = configured.createObjectInputStream(reader);
  try {
    return in.readObject();

代码示例来源:origin: apache/cloudstack

xstream.alias("useraccount", UserAccountVO.class);
xstream.aliasField("id", UserAccountVO.class, "uuid");
try(ObjectInputStream in = xstream.createObjectInputStream(is);) {
  return (UserAccountVO)in.readObject();
} catch (IOException e) {

代码示例来源:origin: apache/cloudstack

xstream.aliasField("parentdomainid", RegionDomain.class, "parentUuid");
xstream.aliasField("networkdomain", DomainVO.class, "networkDomain");
try(ObjectInputStream in = xstream.createObjectInputStream(is);) {
  return (RegionDomain) in.readObject();
}catch (IOException e) {

代码示例来源:origin: apache/cloudstack

xstream.aliasField("id", RegionUser.class, "uuid");
xstream.aliasField("accountId", RegionUser.class, "accountUuid");
try(ObjectInputStream in = xstream.createObjectInputStream(is);) {
  return (RegionAccount) in.readObject();
}catch (IOException e) {

代码示例来源:origin: apache/cloudstack

try (ObjectInputStream inOld = xs.createObjectInputStream(new FileReader(oldFile));){
  while (true) {
    Command c1 = (Command)inOld.readObject();
try (ObjectInputStream inNew = xs.createObjectInputStream(new FileReader(newFile));){
  while (true) {
    Command c = (Command)inNew.readObject();

代码示例来源:origin: org.jvnet.hudson/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from an InputStream using
 * XStream.
 *
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter, String)
 * @since 1.3
 */
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(in));
}

代码示例来源:origin: com.haulmont.thirdparty/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from an InputStream
 * using XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.3
 */
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(in));
}

代码示例来源:origin: x-stream/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from an InputStream using XStream.
 *
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter, String)
 * @since 1.3
 */
public ObjectInputStream createObjectInputStream(final InputStream in) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(in));
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from an InputStream
 * using XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.3
 */
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(in));
}

代码示例来源:origin: x-stream/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from a reader using XStream.
 *
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter, String)
 * @since 1.0.3
 */
public ObjectInputStream createObjectInputStream(final Reader xmlReader) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(xmlReader));
}

代码示例来源:origin: org.jvnet.hudson/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from a reader using
 * XStream.
 *
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter, String)
 * @since 1.0.3
 */
public ObjectInputStream createObjectInputStream(Reader xmlReader) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(xmlReader));
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from a reader using
 * XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.0.3
 */
public ObjectInputStream createObjectInputStream(Reader xmlReader) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(xmlReader));
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from an InputStream
 * using XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.3
 */
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(in));
}

代码示例来源:origin: org.agiso.tempel/tempel-core

@Override
public void process(InputStream xmlStream, ITempelEntryProcessor entryProcessor) throws Exception {
  ObjectInputStream in = xStream.createObjectInputStream(xmlStream);
  try {
    while(true) {
      entryProcessor.processObject(in.readObject());
    }
  } catch(EOFException e) {
    // Normalne zakończenie przetwarzania pliku szablonu
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from a reader using
 * XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.0.3
 */
public ObjectInputStream createObjectInputStream(Reader xmlReader) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(xmlReader));
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from an InputStream
 * using XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.3
 */
public ObjectInputStream createObjectInputStream(InputStream in) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(in));
}

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

/**
 * Creates an ObjectInputStream that deserializes a stream of objects from a reader using
 * XStream.
 * 
 * @see #createObjectInputStream(com.thoughtworks.xstream.io.HierarchicalStreamReader)
 * @see #createObjectOutputStream(com.thoughtworks.xstream.io.HierarchicalStreamWriter,
 *      String)
 * @since 1.0.3
 */
public ObjectInputStream createObjectInputStream(Reader xmlReader) throws IOException {
  return createObjectInputStream(hierarchicalStreamDriver.createReader(xmlReader));
}

相关文章