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
| Modifier and Type | Class and Description |
|---|---|
| protected class | |
| private class | POIFSStream.
Class that handles a streaming read of one stream |
| private class | POIFSStream.
Class that handles a streaming read of one stream |
| Modifier and Type | Field and Description |
|---|---|
| private final BlockStore | |
| private OutputStream | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| pack-priv Iterator | |
| pack-priv Iterator | |
| public OutputStream | |
| public int | |
| public Iterator | iterator()
Implements java. Returns an iterator that'll supply one |
| pack-priv void |
| blockStore | back to summary |
|---|---|
| private final BlockStore blockStore | |
| outStream | back to summary |
|---|---|
| private OutputStream outStream | |
| startBlock | back to summary |
|---|---|
| private int startBlock | |
| POIFSStream | back to summary |
|---|---|
| public POIFSStream(BlockStore blockStore, int startBlock) Constructor for an existing stream. It's up to you
to know how to get the start block (eg from a
| |
| POIFSStream | back to summary |
|---|---|
| public POIFSStream(BlockStore blockStore) Constructor for a new stream. A start block won't be allocated until you begin writing to it. | |
| free | back to summary |
|---|---|
| public void free() throws IOException Frees all blocks in the stream | |
| free | back to summary |
|---|---|
| private void free(BlockStore. | |
| getBlockIterator | back to summary |
|---|---|
| pack-priv Iterator | |
| getBlockOffsetIterator | back to summary |
|---|---|
| pack-priv Iterator | |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() throws IOException | |
| getStartBlock | back to summary |
|---|---|
| public int getStartBlock() What block does this stream start at?
Will be | |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Returns an iterator that'll supply one
| |
| updateContents | back to summary |
|---|---|
| pack-priv void updateContents(byte[] contents) throws IOException Updates the contents of the stream to the new set of bytes. Note - if this is property based, you'll still need to update the size in the property yourself | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv ByteBuffer | |
| pack-priv BlockStore. | |
| pack-priv int | |
| pack-priv byte[] | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| pack-priv void | |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Writes |
| buffer | back to summary |
|---|---|
| pack-priv ByteBuffer buffer | |
| loopDetector | back to summary |
|---|---|
| pack-priv BlockStore. | |
| nextBlock | back to summary |
|---|---|
| pack-priv int nextBlock | |
| oneByte | back to summary |
|---|---|
| pack-priv byte[] oneByte | |
| prevBlock | back to summary |
|---|---|
| pack-priv int prevBlock | |
| StreamBlockByteBuffer | back to summary |
|---|---|
| pack-priv StreamBlockByteBuffer() throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| createBlockIfNeeded | back to summary |
|---|---|
| pack-priv void createBlockIfNeeded() throws IOException | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| Modifier and Type | Field and Description |
|---|---|
| private final BlockStore. | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public ByteBuffer | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| loopDetector | back to summary |
|---|---|
| private final BlockStore. | |
| nextBlock | back to summary |
|---|---|
| private int nextBlock | |
| StreamBlockByteBufferIterator | back to summary |
|---|---|
| pack-priv StreamBlockByteBufferIterator(int firstBlock) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public ByteBuffer next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |
| Modifier and Type | Field and Description |
|---|---|
| private final BlockStore. | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Integer | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| loopDetector | back to summary |
|---|---|
| private final BlockStore. | |
| nextBlock | back to summary |
|---|---|
| private int nextBlock | |
| StreamBlockOffsetIterator | back to summary |
|---|---|
| pack-priv StreamBlockOffsetIterator(int firstBlock) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public Integer next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |