org.ccnx.ccn.io.CCNDescriptor Class Reference
A file descriptor-style wrapper around CCNVersionedInputStream and CCNVersionedOutputStream.
More...
List of all members.
Public Types |
enum | OpenMode { O_RDONLY,
O_WRONLY
} |
enum | SeekWhence { SEEK_SET,
SEEK_CUR,
SEEK_END
} |
Public Member Functions |
| CCNDescriptor (ContentName name, PublisherPublicKeyDigest publisher, CCNHandle handle, boolean openForWriting) throws IOException |
| Open a new descriptor for reading or writing (but not both).
|
int | available () throws IOException |
boolean | openForReading () |
boolean | openForWriting () |
void | close () throws IOException |
| Close underlying stream.
|
void | flush () throws IOException |
| Flush output stream if open for writing.
|
boolean | eof () |
int | read (byte[] buf, int offset, int len) throws IOException |
| See CCNInputStream.read(byte[], int, int).
|
int | read (byte[] b) throws IOException |
| See CCNInputStream.read(byte[]).
|
void | write (byte[] buf, int offset, int len) throws IOException |
| See CCNOutputStream.writeToNetwork(byte[], long, long).
|
void | setTimeout (int timeout) |
| Sets the timeout for the underlying stream.
|
Protected Member Functions |
void | openForReading (ContentName name, PublisherPublicKeyDigest publisher, CCNHandle handle) throws IOException |
void | openForWriting (ContentName name, PublisherPublicKeyDigest publisher, CCNHandle handle) throws IOException |
Protected Attributes |
CCNInputStream | _input = null |
CCNOutputStream | _output = null |
Detailed Description
A file descriptor-style wrapper around CCNVersionedInputStream and CCNVersionedOutputStream.
Constructor & Destructor Documentation
Open a new descriptor for reading or writing (but not both).
- Parameters:
-
- Exceptions:
-
Member Function Documentation
int org.ccnx.ccn.io.CCNDescriptor.available |
( |
|
) |
throws IOException |
- Returns:
- If open for reading, returns result of CCNInputStream.available(), otherwise returns 0.
- Exceptions:
-
void org.ccnx.ccn.io.CCNDescriptor.close |
( |
|
) |
throws IOException |
Close underlying stream.
- Exceptions:
-
boolean org.ccnx.ccn.io.CCNDescriptor.eof |
( |
|
) |
|
void org.ccnx.ccn.io.CCNDescriptor.flush |
( |
|
) |
throws IOException |
Flush output stream if open for writing.
- Exceptions:
-
boolean org.ccnx.ccn.io.CCNDescriptor.openForReading |
( |
|
) |
|
- Returns:
- true if opened for reading
boolean org.ccnx.ccn.io.CCNDescriptor.openForWriting |
( |
|
) |
|
- Returns:
- true if opened for writing
void org.ccnx.ccn.io.CCNDescriptor.setTimeout |
( |
int |
timeout |
) |
|
Sets the timeout for the underlying stream.
- Parameters:
-
The documentation for this class was generated from the following file:
- src/org/ccnx/ccn/io/CCNDescriptor.java