sleep.bridges.io
Class BufferObject

java.lang.Object
  extended by sleep.bridges.io.IOObject
      extended by sleep.bridges.io.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  java.io.ByteArrayInputStream readme
          The readable source for this IO object
protected  java.io.ByteArrayOutputStream source
          The writeable source for this IO object
 
Fields inherited from class sleep.bridges.io.IOObject
buffer, in, out, reader, readerb, readeru, thread, token, writerb, writeru
 
Constructor Summary
BufferObject()
           
 
Method Summary
 void allocate(int initialSize)
          allocates a writeable buffer with the specified initial capacity
 void close()
          handles our closing semantices i.e.
 java.lang.Object getSource()
          returns the stream referenced by this IOObject
 
Methods inherited from class sleep.bridges.io.IOObject
getBuffer, getConsole, getInputBuffer, getInputStream, getOutputStream, getReader, getThread, getToken, getWriter, isEOF, openRead, openWrite, print, printLine, readCharacter, readLine, sendEOF, setEncoding, setThread, setToken, wait
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected java.io.ByteArrayOutputStream source
The writeable source for this IO object


readme

protected java.io.ByteArrayInputStream readme
The readable source for this IO object

Constructor Detail

BufferObject

public BufferObject()
Method Detail

getSource

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

Overrides:
getSource in class IOObject

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

Overrides:
close in class IOObject

allocate

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