Package M2Crypto :: Module BIO :: Class MemoryBuffer
[frames] | no frames]

Class MemoryBuffer




Object interface to BIO_s_mem.

Empirical testing suggests that this class performs less well than cStringIO, because cStringIO is implemented in C, whereas this class is implemented in Python. Thus, the recommended practice is to use cStringIO for regular work and convert said cStringIO object to a MemoryBuffer object only when necessary.

Instance Methods
 
__init__(self, data=None)
 
__len__(self)
 
read(self, size=0)
 
read_all(self, size=0)
 
getvalue(self, size=0)
 
write_close(self)
 
close(self)

Inherited from BIO: __del__, bio_ptr, fileno, flush, m2_bio_free, readable, readline, readlines, reset, should_read, should_retry, should_write, write, writeable

Method Details

__init__(self, data=None)
(Constructor)

 
Overrides: BIO.__init__

read(self, size=0)

 
Overrides: BIO.read

write_close(self)

 
Overrides: BIO.write_close

close(self)

 
Overrides: BIO.close