bees.core
Class CapabilityStreamer
java.lang.Object
|
+--bees.core.CapabilityStreamer
- public final class CapabilityStreamer
- extends java.lang.Object
Helper class used to encode and decode capabilities to data streams.
Warning: This can be used to reveal a capabilities private data, it must
not be exported to untrusted code.
Method Summary |
java.lang.Object |
read(java.io.DataInputStream is)
Read a capability from the given input stream. |
java.lang.String |
toString()
|
void |
write(Capability cap,
java.io.DataOutputStream os)
Write a capability to the given output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CapabilityStreamer
public CapabilityStreamer(KernelObjectStore store)
- Construct a CapabilityStreamer that can read/write capabilities from
the given store.
- Parameters:
store
- The KernelObjectStore used to hold KernelObjects.
read
public java.lang.Object read(java.io.DataInputStream is)
throws java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.io.IOException
- Read a capability from the given input stream.
- Parameters:
is
- The DataInputStream used to read capabilities.- Returns:
- The manufactured capability.
- Throws:
java.lang.ClassNotFoundException
- if the Capability class couldn't be
found.java.lang.InstantiationException
- if there was a problem instantiating the
capability object.java.lang.IllegalAccessException
- if there was a problem accessing the
capability's constructor method.java.io.IOException
- if there was a problem reading the flattened version
of the capability.
write
public void write(Capability cap,
java.io.DataOutputStream os)
throws java.io.IOException
- Write a capability to the given output stream.
- Parameters:
cap
- The capability to write to the stream.os
- The DataOutputStream used to write capabilities.- Throws:
java.io.IOException
- if there was a problem reading the flattened version
of the capability.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- See Also:
Object.toString()
This documentation is Copyright (C) 2002 The University of Utah. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for Bees v0.5.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/