com.wewebu.ow.server.util.upload
Class OwFileUpStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.wewebu.ow.server.util.upload.OwFileUpStream
All Implemented Interfaces:
Closeable

public class OwFileUpStream
extends FilterInputStream

PartInputStream filters a ServletInputStream, providing access to a single MIME part contained with in which ends with the boundary specified. It uses buffering to provide performance.

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
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
OwFileUpStream(javax.servlet.ServletInputStream in_p, String boundary_p)
          Creates a PartInputStream which stops at the specified boundary from a ServletInputStream.
 
Method Summary
 int available()
          Returns the number of bytes that can be read from this input stream without blocking.
 void close()
          Closes this input stream and releases any system resources associated with the stream.
 int read()
          Reads the next byte of data from the InputStream.
 int read(byte[] b_p)
          Reads some number of bytes from the input stream and stores them into the buffer array.
 int read(byte[] b_p, int off_p, int len_p)
          Read upto len bytes of data from inputstream into an array of bytes.
 
Methods inherited from class java.io.FilterInputStream
mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwFileUpStream

public OwFileUpStream(javax.servlet.ServletInputStream in_p,
                      String boundary_p)
               throws IOException
Creates a PartInputStream which stops at the specified boundary from a ServletInputStream.

Parameters:
in_p -
boundary_p -
Throws:
IOException
Method Detail

read

public int read()
         throws IOException
Reads the next byte of data from the InputStream.

Overrides:
read in class FilterInputStream
Returns:
int the next byte of data, or -1 if the end of the stream is reached.
Throws:
IOException - if an input or output exception has occurred.

read

public int read(byte[] b_p)
         throws IOException
Reads some number of bytes from the input stream and stores them into the buffer array. The number of bytes actually read is returned as integer. This method blocks untill input data is available, end of file is detected, or exception is thrown

Overrides:
read in class FilterInputStream
Parameters:
b_p - the byte array buffer into which the data is read.
Throws:
IOException

read

public int read(byte[] b_p,
                int off_p,
                int len_p)
         throws IOException
Read upto len bytes of data from inputstream into an array of bytes. The number of bytes actually read is returned as integer. This method blocks untill input data is available, end of file is detected, or an exception is thrown.

Overrides:
read in class FilterInputStream
Parameters:
b_p - the byte array buffer into which the data is read.
off_p - int the start offset of the data.
len_p - int the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached
Returns:
int
Throws:
IOException - if an I/O error occurs.

available

public int available()
              throws IOException
Returns the number of bytes that can be read from this input stream without blocking.

Overrides:
available in class FilterInputStream
Returns:
the number of bytes that can be read from the input stream without blocking.
Throws:
IOException - if an I/O error occurs.

close

public void close()
           throws IOException
Closes this input stream and releases any system resources associated with the stream.

Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream
Throws:
IOException - if an I/O error occurs.


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.