com.wewebu.ow.server.util
Class OwStreamUtil

java.lang.Object
  extended by com.wewebu.ow.server.util.OwStreamUtil

public class OwStreamUtil
extends Object

Utility class for Streams.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
static int BUFFER_SIZE
          buffer for read and write
static int MIN_READ
          min size if read is blocked
 
Constructor Summary
OwStreamUtil()
           
 
Method Summary
static void upload(InputStream in_p, OutputStream out_p, boolean fClose_p)
          upload the given OutputStream to the given InputStream The InputStream (in_p) and OutputStream (out_p) are closed
static void upload(InputStream in_p, OutputStream out_p, boolean fClose_p, int bufSize_p)
          Helper method which redirect the input stream to the output stream, using a buffer with given size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
buffer for read and write

See Also:
Constant Field Values

MIN_READ

public static final int MIN_READ
min size if read is blocked

See Also:
Constant Field Values
Constructor Detail

OwStreamUtil

public OwStreamUtil()
Method Detail

upload

public static void upload(InputStream in_p,
                          OutputStream out_p,
                          boolean fClose_p)
                   throws Exception
upload the given OutputStream to the given InputStream The InputStream (in_p) and OutputStream (out_p) are closed

Parameters:
in_p - InputStream
out_p - OutputStream
fClose_p - Close the stream after finishing
Throws:
Exception

upload

public static void upload(InputStream in_p,
                          OutputStream out_p,
                          boolean fClose_p,
                          int bufSize_p)
                   throws IOException
Helper method which redirect the input stream to the output stream, using a buffer with given size.

Parameters:
in_p - InputStream to redirect
out_p - OutputStream for redirection
fClose_p - flag for closing streams at the end
bufSize_p - int buffer size to be used for redirection
Throws:
IOException - if any problems during redirection
Since:
3.1.0.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.