public final class LimitedStreamCopier
extends java.lang.Object
InputStream to an OutputStream.
The copy can be performed with an optional byte limit and as soon as this limit is reached,
the copy will be stopped immediately and a ContentLimitViolationException will be thrown.| Constructor and Description |
|---|
LimitedStreamCopier() |
| Modifier and Type | Method and Description |
|---|---|
int |
copyStreams(java.io.InputStream in,
java.io.OutputStream out,
long sizeLimit)
Copy of the the Spring FileCopyUtils, but does not silently absorb IOExceptions
when the streams are closed.
|
public final int copyStreams(java.io.InputStream in,
java.io.OutputStream out,
long sizeLimit)
throws java.io.IOException
in - the stream from which to read content.out - the stream to which to write content.sizeLimit - the maximum number of bytes that will be copied between the streams before a
ContentLimitViolationException will be thrown.
A negative number or zero will be deemed to mean 'no limit'.java.io.IOExceptionCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.