|
7
|
| Christopher Klewes · 技术社区 · 15 年前 |
|
|
1
10
Transformer t = // getTransformer(); ByteArrayOutputStream os = new ByteArrayOutputStream(); Result result = new StreamResult(os); t.transform(inputSource, result); return new ByteArrayInputStream(os.getByteArray());
当然,如果
PipedInputStream is = new PipedInputStream(); PipedOutputStream os = new PipedOutputStream(is); Result result = new StreamResult(os); // This creates and starts a thread that creates a transformer // and applies it to the method parameters. spawnTransformerThread(inputSource, result); return is; |
|
|
2
0
通常是不可能的,除非它能被铸造成 StreamSource 或其他 implementations . |