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

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

本文整理了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

  1. public boolean bufferEntity() throws MessageProcessingException {
  2. checkEntityIsClosed();
  3. if (!entityBufferred && entity instanceof InputStream) {
  4. try {
  5. InputStream oldEntity = (InputStream)entity;
  6. entity = IOUtils.loadIntoBAIS(oldEntity);
  7. oldEntity.close();
  8. entityBufferred = true;
  9. } catch (IOException ex) {
  10. throw new MessageProcessingException(ex);
  11. }
  12. }
  13. return entityBufferred;
  14. }

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

  1. public boolean bufferEntity() throws ProcessingException {
  2. checkEntityIsClosed();
  3. if (!entityBufferred && entity instanceof InputStream) {
  4. try {
  5. InputStream oldEntity = (InputStream)entity;
  6. entity = IOUtils.loadIntoBAIS(oldEntity);
  7. oldEntity.close();
  8. entityBufferred = true;
  9. } catch (IOException ex) {
  10. throw new ResponseProcessingException(this, ex);
  11. }
  12. }
  13. return entityBufferred;
  14. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章