org.apache.jackrabbit.core.util.db
Class StreamWrapper

java.lang.Object
  extended by org.apache.jackrabbit.core.util.db.StreamWrapper

public class StreamWrapper
extends Object


Constructor Summary
StreamWrapper(InputStream in, long size)
          Creates a wrapper for the given InputStream that can safely be passed as a parameter to the ConnectionHelper.exec(String, Object...), ConnectionHelper.exec(String, Object[], boolean, int) and ConnectionHelper.update(String, Object[]) methods.
 
Method Summary
 void cleanupResources()
          Cleans up the internal Resources
 long getSize()
           
 InputStream getStream()
           
 boolean resetStream()
          Resets the internal InputStream that it could be re-read.
Is used from RetryManager if a SQLException has occurred.
At the moment only a TempFileInputStream can be reseted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamWrapper

public StreamWrapper(InputStream in,
                     long size)
Creates a wrapper for the given InputStream that can safely be passed as a parameter to the ConnectionHelper.exec(String, Object...), ConnectionHelper.exec(String, Object[], boolean, int) and ConnectionHelper.update(String, Object[]) methods. If the wrapped Stream is a TempFileInputStream it will be wrapped again by a BufferedInputStream.

Parameters:
in - the InputStream to wrap
size - the size of the input stream
Method Detail

getStream

public InputStream getStream()

getSize

public long getSize()

cleanupResources

public void cleanupResources()
Cleans up the internal Resources


resetStream

public boolean resetStream()
Resets the internal InputStream that it could be re-read.
Is used from RetryManager if a SQLException has occurred.
At the moment only a TempFileInputStream can be reseted.

Returns:
returns true if it was able to reset the Stream


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.