Package muntjac :: Package terminal :: Package gwt :: Package server :: Module abstract_communication_manager :: Class SimpleMultiPartInputStream
[hide private]
[frames] | no frames]

Class SimpleMultiPartInputStream

source code

StringIO.StringIO --+
                    |
                   SimpleMultiPartInputStream

Stream that extracts content from another stream until the boundary string is encountered.

Public only for unit tests, should be considered private for all other purposes.

Instance Methods [hide private]
 
__init__(self, realInputStream, boundaryString, manager) source code
 
getvalue(self)
Retrieve the entire contents of the "file" at any time before the StringIO object's close() method is called.
source code
 
matchForBoundary(self)
Reads the input to expect a boundary string.
source code
 
getBuffered(self)
Returns the partly matched boundary string and the byte following that.
source code

Inherited from StringIO.StringIO: __iter__, close, flush, isatty, next, read, readline, readlines, seek, tell, truncate, write, writelines

Method Details [hide private]

__init__(self, realInputStream, boundaryString, manager)
(Constructor)

source code 
Overrides: StringIO.StringIO.__init__

getvalue(self)

source code 

Retrieve the entire contents of the "file" at any time before the StringIO object's close() method is called.

The StringIO object can accept either Unicode or 8-bit strings, but mixing the two may take some care. If both are used, 8-bit strings that cannot be interpreted as 7-bit ASCII (that use the 8th bit) will cause a UnicodeError to be raised when getvalue() is called.

Overrides: StringIO.StringIO.getvalue
(inherited documentation)

matchForBoundary(self)

source code 

Reads the input to expect a boundary string. Expects that the first character has already been matched.

Returns:
-1 if the boundary was matched, else returns the first byte from boundary
Raises:
  • IOException

getBuffered(self)

source code 

Returns the partly matched boundary string and the byte following that.

Raises:
  • IOException