sleep.bridges.io

Class BufferObject

public class BufferObject extends IOObject

The buffer works as follows. Once allocated it is open for writing. When the scripter chooses to close the buffer it is then available for reading. The second time it is closed all of its resources are deallocated.
Field Summary
protected ByteArrayInputStreamreadme
The readable source for this IO object
protected ByteArrayOutputStreamsource
The writeable source for this IO object
Method Summary
voidallocate(int initialSize)
allocates a writeable buffer with the specified initial capacity
voidclose()
handles our closing semantices i.e. first time it is called the writeable portion is opened up for reading and the second time all resources are deallocated
ObjectgetSource()
returns the stream referenced by this IOObject

Field Detail

readme

protected ByteArrayInputStream readme
The readable source for this IO object

source

protected ByteArrayOutputStream source
The writeable source for this IO object

Method Detail

allocate

public void allocate(int initialSize)
allocates a writeable buffer with the specified initial capacity

close

public void close()
handles our closing semantices i.e. first time it is called the writeable portion is opened up for reading and the second time all resources are deallocated

getSource

public Object getSource()
returns the stream referenced by this IOObject