org.apache.cxf.helpers.IOUtils.loadIntoBAIS()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(127)

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

IOUtils.loadIntoBAIS介绍

[英]Load the InputStream into memory and return a ByteArrayInputStream that represents it. Closes the in stream.
[中]将InputStream加载到内存中,并返回表示它的ByteArrayInputStream。关闭流中的。

代码示例

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public boolean bufferEntity() throws MessageProcessingException {
  checkEntityIsClosed();
  if (!entityBufferred && entity instanceof InputStream) {
    try {
      InputStream oldEntity = (InputStream)entity;
      entity = IOUtils.loadIntoBAIS(oldEntity);
      oldEntity.close();
      entityBufferred = true;
    } catch (IOException ex) {
      throw new MessageProcessingException(ex);
    }
  }
  return entityBufferred;
}

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

public boolean bufferEntity() throws ProcessingException {
  checkEntityIsClosed();
  if (!entityBufferred && entity instanceof InputStream) {
    try {
      InputStream oldEntity = (InputStream)entity;
      entity = IOUtils.loadIntoBAIS(oldEntity);
      oldEntity.close();
      entityBufferred = true;
    } catch (IOException ex) {
      throw new ResponseProcessingException(this, ex);
    }
  }
  return entityBufferred;
}

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

private void loadSchemasIntoCache(String loc) throws Exception {
  InputStream is = ResourceUtils.getResourceStream(loc,
    bus == null ? BusFactory.getDefaultBus() : bus);
  if (is == null) {
    return;
  }
  try (ByteArrayInputStream bis = IOUtils.loadIntoBAIS(is)) {
    XMLSource source = new XMLSource(bis);
    source.setBuffering();
    String targetNs = source.getValue("/*/@targetNamespace");
    Map<String, String> nsMap = Collections.singletonMap("xs", Constants.URI_2001_SCHEMA_XSD);
    String[] elementNames = source.getValues("/*/xs:element/@name", nsMap);
    externalQnamesMap.put(targetNs, Arrays.asList(elementNames));
    String schemaValue = source.getNode("/xs:schema", nsMap, String.class);
    externalSchemasCache.add(schemaValue);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

private void loadSchemasIntoCache(String loc) throws Exception {
  InputStream is = ResourceUtils.getResourceStream(loc, 
    bus == null ? BusFactory.getDefaultBus() : bus);
  if (is == null) {
    return;
  }
  ByteArrayInputStream bis = IOUtils.loadIntoBAIS(is);
  XMLSource source = new XMLSource(bis);
  source.setBuffering();
  String targetNs = source.getValue("/*/@targetNamespace");
  Map<String, String> nsMap = Collections.singletonMap("xs", XmlSchemaConstants.XSD_NAMESPACE_URI);
  String[] elementNames = source.getValues("/*/xs:element/@name", nsMap);
  externalQnamesMap.put(targetNs, Arrays.asList(elementNames));
  String schemaValue = source.getNode("/xs:schema", nsMap, String.class);
  externalSchemasCache.add(schemaValue);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-service-description

private void loadSchemasIntoCache(String loc) throws Exception {
  InputStream is = ResourceUtils.getResourceStream(loc,
    bus == null ? BusFactory.getDefaultBus() : bus);
  if (is == null) {
    return;
  }
  try (ByteArrayInputStream bis = IOUtils.loadIntoBAIS(is)) {
    XMLSource source = new XMLSource(bis);
    source.setBuffering();
    String targetNs = source.getValue("/*/@targetNamespace");
    Map<String, String> nsMap = Collections.singletonMap("xs", Constants.URI_2001_SCHEMA_XSD);
    String[] elementNames = source.getValues("/*/xs:element/@name", nsMap);
    externalQnamesMap.put(targetNs, Arrays.asList(elementNames));
    String schemaValue = source.getNode("/xs:schema", nsMap, String.class);
    externalSchemasCache.add(schemaValue);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

InputStream ins = IOUtils.loadIntoBAIS(in.getByteStream());
  in.setByteStream(ins);
} catch (IOException e) {

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

InputStream ins = IOUtils.loadIntoBAIS(in.getByteStream());
  in.setByteStream(ins);
} catch (IOException e) {

代码示例来源:origin: org.apache.cxf/cxf-core

InputStream ins = IOUtils.loadIntoBAIS(in.getByteStream());
  in.setByteStream(ins);
} catch (IOException e) {

代码示例来源:origin: org.apache.cxf/cxf-rt-core

InputStream ins = IOUtils.loadIntoBAIS(in.getByteStream());
  in.setByteStream(ins);
} catch (IOException e) {

相关文章