org.outerj.daisy.repository
Class PartHelper

java.lang.Object
  extended by org.outerj.daisy.repository.PartHelper

public class PartHelper
extends java.lang.Object


Constructor Summary
PartHelper()
           
 
Method Summary
static byte[] streamToByteArrayAndClose(java.io.InputStream is, int sizeHint)
          Reads an inputstream till the end into a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartHelper

public PartHelper()
Method Detail

streamToByteArrayAndClose

public static byte[] streamToByteArrayAndClose(java.io.InputStream is,
                                               int sizeHint)
                                        throws java.io.IOException
Reads an inputstream till the end into a byte array. Closes the input stream whatever happens. Optimized for the case where we know the size of the input on beforehand.

Parameters:
is - the input stream to be read
sizeHint - optional, specify -1 if nothing useful
Throws:
java.io.IOException


Copyright © -2012 . All Rights Reserved.