public class StreamWrapper extends Object
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
void |
closeStream() |
long |
getSize() |
InputStream |
getStream() |
boolean |
resetStream()
Resets the internal InputStream that it could be re-read.
Is used from ConnectionHelper.RetryManager if a SQLException has occurred.It relies on the assumption that the InputStream was not marked anywhere during reading. |
public StreamWrapper(InputStream in, long size)
ConnectionHelper.exec(String, Object...)
,
ConnectionHelper.exec(String, Object[], boolean, int)
and
ConnectionHelper.update(String, Object[])
methods.in
- the InputStream to wrapsize
- the size of the input streampublic InputStream getStream()
public long getSize()
public void closeStream()
public boolean resetStream()
ConnectionHelper.RetryManager
if a SQLException
has occurred.Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.