Package pyamf :: Package util :: Module pure :: Class StringIOProxy
[hide private]
[frames] | no frames]

Class StringIOProxy

source code


I am a StringIO type object containing byte data from the AMF stream.


See Also:
ByteArray on OSFlash, Parsing ByteArrays on OSFlash
Instance Methods [hide private]
 
__init__(self, buf=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
getvalue(self)
Get raw data from buffer.
source code
 
read(self, n=-1)
Reads n bytes from the stream.
source code
 
seek(self, pos, mode=0)
Sets the file-pointer offset, measured from the beginning of this stream, at which the next write operation will occur.
source code
 
tell(self)
Returns the position of the stream pointer.
source code
 
truncate(self, size=0)
Truncates the stream to the specified length.
source code
 
write(self, s, size=None)
Writes the content of the specified s into this buffer.
source code
 
_get_len(self)
Return total number of bytes in buffer.
source code
 
__len__(self) source code
 
consume(self)
Chops the tail off the stream starting at 0 and ending at tell().
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, buf=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Raises:
  • TypeError - Unable to coerce buf to StringIO.
Overrides: object.__init__

seek(self, pos, mode=0)

source code 

Sets the file-pointer offset, measured from the beginning of this stream, at which the next write operation will occur.

Parameters:
  • pos (int)
  • mode (int)

truncate(self, size=0)

source code 

Truncates the stream to the specified length.

Parameters:
  • size (int) - The length of the stream, in bytes.

write(self, s, size=None)

source code 

Writes the content of the specified s into this buffer.

Parameters:
  • s - Raw bytes

consume(self)

source code 

Chops the tail off the stream starting at 0 and ending at tell(). The stream pointer is set to 0 at the end of this function.

Since: 0.4