org.ccnx.ccn.io.CCNFileOutputStream Class Reference

A versioned output stream that adds a header containing file-level metadata to every stream it outputs (see Header for contents). More...

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

org.ccnx.ccn.io.CCNVersionedOutputStream org.ccnx.ccn.io.CCNOutputStream org.ccnx.ccn.io.CCNAbstractOutputStream org.ccnx.ccn.io.RepositoryFileOutputStream

List of all members.

Public Member Functions

 CCNFileOutputStream (ContentName name, CCNHandle handle) throws IOException
 CCNFileOutputStream (ContentName name, PublisherPublicKeyDigest publisher, CCNHandle handle) throws IOException
 CCNFileOutputStream (ContentName name, ContentKeys keys, CCNHandle handle) throws IOException
 CCNFileOutputStream (ContentName name, KeyLocator locator, PublisherPublicKeyDigest publisher, ContentKeys keys, CCNHandle handle) throws IOException
 CCNFileOutputStream (ContentName name, KeyLocator locator, PublisherPublicKeyDigest publisher, ContentType type, ContentKeys keys, CCNHandle handle) throws IOException

Protected Member Functions

 CCNFileOutputStream (ContentName name, KeyLocator locator, PublisherPublicKeyDigest publisher, ContentType type, ContentKeys keys, CCNFlowControl flowControl) throws IOException
void writeHeader () throws ContentEncodingException, IOException
 Writes the header to the network.
void closeNetworkData () throws ContentEncodingException, IOException, InvalidKeyException, SignatureException, NoSuchAlgorithmException, InterruptedException
 Subclasses that want to do something other than write a header at the end should override this, not close(), because CCNOutputStream.close() currently calls waitForPutDrain, and we don't want to call that till after we've put the header.
void putHeader (ContentName name, long contentLength, int blockSize, byte[] contentDigest, byte[] contentTreeAuthenticator) throws ContentEncodingException, IOException
 Actually put the header blocks (versioned, though that isn't necessary) onto the wire.


Detailed Description

A versioned output stream that adds a header containing file-level metadata to every stream it outputs (see Header for contents).

Reading this content with CCNFileInputStream will allow retrieval of both the content (including automatic retrieval of the latest version, if desired), and the header.


Member Function Documentation

void org.ccnx.ccn.io.CCNFileOutputStream.writeHeader (  )  throws ContentEncodingException, IOException [protected]

Writes the header to the network.

Exceptions:
IOException 

void org.ccnx.ccn.io.CCNFileOutputStream.closeNetworkData (  )  throws ContentEncodingException, IOException, InvalidKeyException, SignatureException, NoSuchAlgorithmException, InterruptedException [protected]

Subclasses that want to do something other than write a header at the end should override this, not close(), because CCNOutputStream.close() currently calls waitForPutDrain, and we don't want to call that till after we've put the header.

When we can, we might want to write the header earlier. Here we wait till we know how many bytes are in the file.

Exceptions:
ContentEncodingException 
IOException 
InterruptedException 
NoSuchAlgorithmException 
SignatureException 
InvalidKeyException 

Reimplemented from org.ccnx.ccn.io.CCNOutputStream.


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

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