org.backsource.utils.io
Class ByteCachedStream

java.lang.Object
  extended byorg.backsource.utils.io.ByteCachedStream
All Implemented Interfaces:
CachedStream
Direct Known Subclasses:
DOMCachedStream, FileCachedStream

public class ByteCachedStream
extends java.lang.Object
implements CachedStream

A CachedStream that returnes streams that are cached in memory in a byte array.

Version:
$Revision: 1.1.1.1 $
Author:
Peter Antman

Constructor Summary
ByteCachedStream()
           
 
Method Summary
 CachedInputStream getInputStream(CachedOutputStream cout)
          Get a rewindable input stream from the given CachedOutputStream.
 CachedInputStream getInputStream(java.io.InputStream is)
          Get a rewindable inputstream from the given input stream, if the stream is a Rewindable input stream, it is just returned.
 CachedOutputStream getOutputStream()
          Get a CachedOutputStream.
 java.lang.String getProperty(java.lang.String name)
          Chech if property is set, allways returns null.
 void rewind(java.io.InputStream is)
          Rewind this stream if it is rewindable, otherwise throw an IOException.
 void setProperty(java.lang.String name, java.lang.String value)
          Empty implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteCachedStream

public ByteCachedStream()
Method Detail

getOutputStream

public CachedOutputStream getOutputStream()
                                   throws java.io.IOException
Get a CachedOutputStream.

The typical usecase for this is to later use it to get a CachedInputStream from it.

Specified by:
getOutputStream in interface CachedStream
Throws:
java.io.IOException

getInputStream

public CachedInputStream getInputStream(CachedOutputStream cout)
                                 throws java.io.IOException
Get a rewindable input stream from the given CachedOutputStream.

Specified by:
getInputStream in interface CachedStream
Throws:
java.io.IOException - if the CachedOutputStream is not of the correct type (not from the same cache) or if an underlying IOException happens.

getInputStream

public CachedInputStream getInputStream(java.io.InputStream is)
                                 throws java.io.IOException
Get a rewindable inputstream from the given input stream, if the stream is a Rewindable input stream, it is just returned.

Specified by:
getInputStream in interface CachedStream
Throws:
java.io.IOException

rewind

public void rewind(java.io.InputStream is)
            throws java.io.IOException
Rewind this stream if it is rewindable, otherwise throw an IOException.

Specified by:
rewind in interface CachedStream
Throws:
java.io.IOException

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Empty implementation.

Specified by:
setProperty in interface CachedStream

getProperty

public java.lang.String getProperty(java.lang.String name)
Chech if property is set, allways returns null.

Specified by:
getProperty in interface CachedStream


Copyright © 2000-2004 Backsource. All Rights Reserved.