public class NPOIFSStream
extends java.lang.Object
implements java.lang.Iterable<java.nio.ByteBuffer>
NPOIFSFileSystem
. 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 appendModifier and Type | Class and Description |
---|---|
protected class |
NPOIFSStream.StreamBlockByteBufferIterator
Class that handles a streaming read of one stream
|
Constructor and Description |
---|
NPOIFSStream(BlockStore blockStore)
Constructor for a new stream.
|
NPOIFSStream(BlockStore blockStore,
int startBlock)
Constructor for an existing stream.
|
Modifier and Type | Method and Description |
---|---|
void |
free()
Frees all blocks in the stream
|
java.util.Iterator<java.nio.ByteBuffer> |
getBlockIterator() |
int |
getStartBlock()
What block does this stream start at?
|
java.util.Iterator<java.nio.ByteBuffer> |
iterator()
Returns an iterator that'll supply one
ByteBuffer
per block in the stream. |
void |
updateContents(byte[] contents)
Updates the contents of the stream to the new
set of bytes.
|
public NPOIFSStream(BlockStore blockStore, int startBlock)
HeaderBlock
or a Property
)public NPOIFSStream(BlockStore blockStore)
public int getStartBlock()
POIFSConstants.END_OF_CHAIN
for a
new stream that hasn't been written to yet.public java.util.Iterator<java.nio.ByteBuffer> iterator()
ByteBuffer
per block in the stream.iterator
in interface java.lang.Iterable<java.nio.ByteBuffer>
public java.util.Iterator<java.nio.ByteBuffer> getBlockIterator()
public void updateContents(byte[] contents) throws java.io.IOException
java.io.IOException
public void free() throws java.io.IOException
java.io.IOException
Copyright © 2005-2010 Potix Corporation. All Rights Reserved.