A versioned output stream that adds a header containing file-level metadata to every stream it outputs (see Header for contents). More...
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. |
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.
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.
ContentEncodingException | ||
IOException | ||
InterruptedException | ||
NoSuchAlgorithmException | ||
SignatureException | ||
InvalidKeyException |
Reimplemented from org.ccnx.ccn.io.CCNOutputStream.
void org.ccnx.ccn.io.CCNFileOutputStream.writeHeader | ( | ) | throws ContentEncodingException, IOException [protected] |
Writes the header to the network.
IOException |