com.atlassian.core.spool
Class ByteArraySpool

java.lang.Object
  extended by com.atlassian.core.spool.ByteArraySpool
All Implemented Interfaces:
Spool

public class ByteArraySpool
extends java.lang.Object
implements Spool

A very simple spool that uses a ByteArray buffer. Default buffer size is 10KiB


Constructor Summary
ByteArraySpool()
           
 
Method Summary
 int getInitialBufferSize()
           
 void setInitialBufferSize(int initialBufferSize)
          Configure the initial size of the byte array buffer.
 java.io.InputStream spool(java.io.InputStream is)
          Return a new InputStream to the data provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArraySpool

public ByteArraySpool()
Method Detail

getInitialBufferSize

public int getInitialBufferSize()

setInitialBufferSize

public void setInitialBufferSize(int initialBufferSize)
Configure the initial size of the byte array buffer.

Parameters:
initialBufferSize - The initial size of the buffer in bytes

spool

public java.io.InputStream spool(java.io.InputStream is)
                          throws java.io.IOException
Description copied from interface: Spool
Return a new InputStream to the data provided. Implementations should guarantee that the returned input stream is independent of the stream passed in. For example, the returned InputStream should still be useable once the original InputStream is closed and its associated resources are released.

Specified by:
spool in interface Spool
Parameters:
is - - Source stream to be spooled
Returns:
Spooled stream
Throws:
java.io.IOException


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.