version 1.0

com.actimind.actiwate.testing.util
Class ByteArrayStreamFactory

java.lang.Object
  extended bycom.actimind.actiwate.testing.util.ByteArrayStreamFactory
All Implemented Interfaces:
InputStreamFactory

public class ByteArrayStreamFactory
extends java.lang.Object
implements InputStreamFactory

Factory for creating InputStreams from byte arrays.


Constructor Summary
ByteArrayStreamFactory(byte[] byteArray)
          Creates a new ByteArrayStreamFactory.
 
Method Summary
 java.io.InputStream createInputStream()
          Creates and returns a new ByteArrayInputStream.
 long getLength()
          Returns stream's length in bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayStreamFactory

public ByteArrayStreamFactory(byte[] byteArray)
                       throws java.lang.IllegalArgumentException
Creates a new ByteArrayStreamFactory.

Parameters:
byteArray - byte array to create InputStreams from.
Throws:
java.lang.IllegalArgumentException - if byteArray is null
Method Detail

getLength

public long getLength()
Returns stream's length in bytes.

Specified by:
getLength in interface InputStreamFactory
Returns:
stream's length.

createInputStream

public java.io.InputStream createInputStream()
                                      throws java.io.IOException
Creates and returns a new ByteArrayInputStream.

Specified by:
createInputStream in interface InputStreamFactory
Returns:
created ByteArrayInputStream.
Throws:
java.io.IOException


Copyright © 2007 Actimind, Inc. All Rights Reserved.