public class POIFSStream
extends java.lang.Object
implements java.lang.Iterable<java.nio.ByteBuffer>
POIFSFileSystem
. It can supply an iterator to read blocks, and way to write out to existing and new blocks. Most users will want a higher level version of this, which deals with properties to track which stream this is. This only works on big block streams, it doesn't handle small block ones. This uses the new NIO code TODO Implement a streaming write method, and append
(这处理在 POIFSFileSystem 中读取和写入流。它可以提供一个迭代器来读取块,以及写出现有块和新块的方式。大多数用户会想要一个更高级别的版本,它处理属性以跟踪这是哪个流。这仅适用于大块流,它不处理小块流。这里使用新的 NIO 代码 TODO 实现流式写入方法,并追加)
Modifier and Type | Class and Description |
---|---|
protected class |
POIFSStream.StreamBlockByteBuffer |
Constructor and Description |
---|
POIFSStream(BlockStore blockStore)
Constructor for a new stream.
|
POIFSStream(BlockStore blockStore, int startBlock)
Constructor for an existing stream.
|
Modifier and Type | Method and Description |
---|---|
void |
free()
Frees all blocks in the stream
(释放流中的所有块)
|
java.io.OutputStream |
getOutputStream() |
int |
getStartBlock()
What block does this stream start at? Will be
POIFSConstants.END_OF_CHAIN for a new stream that hasn't been written to yet.
(这个流从哪个块开始?将是 POIFSConstants。END_OF_CHAIN 用于尚未写入的新流。)
|
java.util.Iterator<java.nio.ByteBuffer> |
iterator()
Returns an iterator that'll supply one
ByteBuffer per block in the stream.
(返回一个迭代器,它将为流中的每个块提供一个 ByteBuffer。)
|
public POIFSStream(BlockStore blockStore, int startBlock)
HeaderBlock
or a
Property
)
(现有流的构造函数。由您决定如何获取起始块(例如从 HeaderBlock 或属性))
public POIFSStream(BlockStore blockStore)
public int getStartBlock()
POIFSConstants.END_OF_CHAIN
for a new stream that hasn't been written to yet.
(这个流从哪个块开始?将是 POIFSConstants。END_OF_CHAIN 用于尚未写入的新流。)
public java.util.Iterator<java.nio.ByteBuffer> iterator()
ByteBuffer
per block in the stream.
(返回一个迭代器,它将为流中的每个块提供一个 ByteBuffer。)
iterator
in interface
java.lang.Iterable<java.nio.ByteBuffer>
(接口 java.lang.Iterable 中的迭代器
public java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
(java.io.IOException)
public void free() throws java.io.IOException
java.io.IOException
(java.io.IOException)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.