org.apache.vinci.transport
Class SimpleTransportable

java.lang.Object
  extended by org.apache.vinci.transport.SimpleTransportable
All Implemented Interfaces:
Transportable

public final class SimpleTransportable
extends java.lang.Object
implements Transportable

SimpleTransportable is an immutable Transportable object that simply writes a byte buffer for its toStream implementation. It can be used for creating lightweight copies of more heavy-weight documents for high performance and simplified synchronization. Because it is immutable, the fromStream() method of this class throws an unchecked exception if invoked.


Constructor Summary
SimpleTransportable(Transportable convert_me)
          Create a SimpleTransportable that is an immutable copy of the provided Transportable object.
 
Method Summary
 KeyValuePair fromStream(java.io.InputStream os)
          Not implemented (throws UnsupportedOperationException if invoked) to preserve immutability.
 void toStream(java.io.OutputStream os)
          Write the object to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTransportable

public SimpleTransportable(Transportable convert_me)
Create a SimpleTransportable that is an immutable copy of the provided Transportable object.

Method Detail

toStream

public void toStream(java.io.OutputStream os)
              throws java.io.IOException
Description copied from interface: Transportable
Write the object to the output stream.

Specified by:
toStream in interface Transportable
Parameters:
os - The stream to write into.
Throws:
java.io.IOException

fromStream

public KeyValuePair fromStream(java.io.InputStream os)
                        throws java.io.IOException
Not implemented (throws UnsupportedOperationException if invoked) to preserve immutability.

Specified by:
fromStream in interface Transportable
Parameters:
os - The stream to read from.
Throws:
java.lang.UnsupportedOperationException - thrown unconditionally.
java.io.IOException


Copyright © 2013. All Rights Reserved.