gpt4 book ai didi

com.thoughtworks.xstream.core.util.XmlHeaderAwareReader类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 20:01:05 26 4
gpt4 key购买 nike

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

XmlHeaderAwareReader介绍

[英]A Reader that evaluates the XML header. It selects its encoding based on the encoding read with the XML header of the provided InputStream. The default encoding is UTF-8 and the version is 1.0 if the stream does not contain an XML header or the attributes are not set within the header.
[中]计算XML头的读取器。它根据使用提供的InputStream的XML头读取的编码来选择其编码。默认编码为UTF-8,如果流不包含XML头或头中未设置属性,则版本为1.0。

代码示例

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map header = getHeader(pin);
  version = Double.parseDouble((String)header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], (String)header.get(KEY_ENCODING));
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map header = getHeader(pin);
  version = Double.parseDouble((String)header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], (String)header.get(KEY_ENCODING));
}

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

@SuppressWarnings("resource")
@Override
public HierarchicalStreamReader createReader(final InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (final UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (final IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map<String, String> header = getHeader(pin);
  version = Double.parseDouble(header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], header.get(KEY_ENCODING));
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map header = getHeader(pin);
  version = Double.parseDouble((String)header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], (String)header.get(KEY_ENCODING));
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map header = getHeader(pin);
  version = Double.parseDouble((String)header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], (String)header.get(KEY_ENCODING));
}

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

public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map header = getHeader(pin);
  version = Double.parseDouble((String)header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], (String)header.get(KEY_ENCODING));
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map header = getHeader(pin);
  version = Double.parseDouble((String)header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], (String)header.get(KEY_ENCODING));
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map header = getHeader(pin);
  version = Double.parseDouble((String)header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], (String)header.get(KEY_ENCODING));
}

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

@SuppressWarnings("resource")
@Override
public HierarchicalStreamReader createReader(final InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (final UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (final IOException e) {
    throw new StreamException(e);
  }
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

/**
 * Constructs an XmlHeaderAwareReader.
 * 
 * @param in the {@link InputStream}
 * @throws UnsupportedEncodingException if the encoding is not supported
 * @throws IOException occurred while reading the XML header
 * @since 1.3
 */
public XmlHeaderAwareReader(final InputStream in) throws UnsupportedEncodingException, IOException {
  final PushbackInputStream[] pin = new PushbackInputStream[]{in instanceof PushbackInputStream
    ? (PushbackInputStream)in
    : new PushbackInputStream(in, 64)};
  final Map header = getHeader(pin);
  version = Double.parseDouble((String)header.get(KEY_VERSION));
  reader = new InputStreamReader(pin[0], (String)header.get(KEY_ENCODING));
}

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

public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(InputStream in) {
  try {
    return createReader(new XmlHeaderAwareReader(in));
  } catch (UnsupportedEncodingException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com