org.ccnx.ccn.io.CCNInputStream Class Reference

Perform sequential reads on any segmented CCN content, as if it were a standard InputStream. More...

Inheritance diagram for org.ccnx.ccn.io.CCNInputStream:

org.ccnx.ccn.io.CCNAbstractInputStream org.ccnx.ccn.CCNContentHandler org.ccnx.ccn.io.CCNVersionedInputStream org.ccnx.ccn.io.CCNFileInputStream

List of all members.

Public Member Functions

 CCNInputStream (ContentName baseName) throws IOException
 Set up an input stream to read segmented CCN content under a given name.
 CCNInputStream (ContentName baseName, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given name.
 CCNInputStream (ContentName baseName, PublisherPublicKeyDigest publisher, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given name.
 CCNInputStream (ContentName baseName, Long startingSegmentNumber, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given name.
 CCNInputStream (ContentName baseName, Long startingSegmentNumber, PublisherPublicKeyDigest publisher, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given name.
 CCNInputStream (ContentName baseName, Long startingSegmentNumber, PublisherPublicKeyDigest publisher, ContentKeys keys, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given name.
 CCNInputStream (ContentObject startingSegment, EnumSet< FlagTypes > flags, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content starting with a given ContentObject that has already been retrieved.
 CCNInputStream (ContentObject startingSegment, ContentKeys keys, EnumSet< FlagTypes > flags, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content starting with a given ContentObject that has already been retrieved.

Protected Member Functions

int readInternal (byte[] buf, int offset, int len) throws IOException
 Implement sequential reads of data across multiple segments.


Detailed Description

Perform sequential reads on any segmented CCN content, as if it were a standard InputStream.

This input stream will read from a sequence of blocks, authenticating each as it goes, and caching what verification information it can to speed up verification of future blocks. All it assumes is that the last component of the name is a segment number as described in SegmentationProfile.

Read buffer size is independent of segment size; the stream will pull additional content fragments dynamically when possible to fill out the requested number of bytes.

Author:
smetters

Constructor & Destructor Documentation

org.ccnx.ccn.io.CCNInputStream.CCNInputStream ( ContentName  baseName  )  throws IOException

Set up an input stream to read segmented CCN content under a given name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. Will use the default handle given by CCNHandle.getHandle(). This constructor will attempt to retrieve the first block of content.

Parameters:
baseName Name to read from. If contains a segment number, will start to read from that segment.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNInputStream.CCNInputStream ( ContentName  baseName,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. This constructor will attempt to retrieve the first block of content.

Parameters:
baseName Name to read from. If contains a segment number, will start to read from that segment.
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNInputStream.CCNInputStream ( ContentName  baseName,
PublisherPublicKeyDigest  publisher,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. This constructor will attempt to retrieve the first block of content.

Parameters:
baseName Name to read from. If contains a segment number, will start to read from that segment.
publisher The key we require to have signed this content. If null, will accept any publisher (subject to higher-level verification).
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNInputStream.CCNInputStream ( ContentName  baseName,
Long  startingSegmentNumber,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. This constructor will attempt to retrieve the first block of content.

Parameters:
baseName Name to read from. If contains a segment number, will start to read from that segment.
startingSegmentNumber Alternative specification of starting segment number. If null, will be SegmentationProfile.baseSegment().
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNInputStream.CCNInputStream ( ContentName  baseName,
Long  startingSegmentNumber,
PublisherPublicKeyDigest  publisher,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. This constructor will attempt to retrieve the first block of content.

Parameters:
baseName Name to read from. If contains a segment number, will start to read from that segment.
startingSegmentNumber Alternative specification of starting segment number. If null, will be SegmentationProfile.baseSegment().
publisher The key we require to have signed this content. If null, will accept any publisher (subject to higher-level verification).
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNInputStream.CCNInputStream ( ContentName  baseName,
Long  startingSegmentNumber,
PublisherPublicKeyDigest  publisher,
ContentKeys  keys,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given name.

This constructor will attempt to retrieve the first block of content.

Parameters:
baseName Name to read from. If contains a segment number, will start to read from that segment.
startingSegmentNumber Alternative specification of starting segment number. If null, will be SegmentationProfile.baseSegment().
publisher The key we require to have signed this content. If null, will accept any publisher (subject to higher-level verification).
keys The keys to use to decrypt this content. If null, assumes content unencrypted, or another process will be used to retrieve the keys.
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNInputStream.CCNInputStream ( ContentObject  startingSegment,
EnumSet< FlagTypes >  flags,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content starting with a given ContentObject that has already been retrieved.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process.

Parameters:
startingSegment The first segment to read from. If this is not the first segment of the stream, reading will begin from this point. We assume that the signature on this segment was verified by our caller.
flags any stream flags that must be set to handle even this first block (otherwise they can be set with setFlags prior to read). Can be null.
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException If startingSegment's name does not contain a valid segment number

org.ccnx.ccn.io.CCNInputStream.CCNInputStream ( ContentObject  startingSegment,
ContentKeys  keys,
EnumSet< FlagTypes >  flags,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content starting with a given ContentObject that has already been retrieved.

Parameters:
startingSegment The first segment to read from. If this is not the first segment of the stream, reading will begin from this point. We assume that the signature on this segment was verified by our caller.
keys The keys to use to decrypt this content. Null if content unencrypted, or another process will be used to retrieve the keys.
flags any stream flags that must be set to handle even this first block (otherwise they can be set with setFlags prior to read). Can be null.
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException If startingSegment's name does not contain a valid segment number


Member Function Documentation

int org.ccnx.ccn.io.CCNInputStream.readInternal ( byte[]  buf,
int  offset,
int  len 
) throws IOException [protected, virtual]

Implement sequential reads of data across multiple segments.

As we run out of bytes on a given segment, the next segment is retrieved and reading continues.

Implements org.ccnx.ccn.io.CCNAbstractInputStream.


The documentation for this class was generated from the following file:

Generated on Thu Feb 16 00:45:01 2012 for Content-Centric Networking in Java by  doxygen 1.5.6