Module prototypes :: Class buffer
[show private | hide private]
[frames | no frames]

Type buffer

object --+
         |
        buffer


This is used for reading and writing byte data
Method Summary
  __init__(self, data)
Call with data to read from it, or with None to write to it
  appendbyte(self, val)
Appends byte to data.
  appendbytes(self, bytes)
Adds bytes to end
  getcurrentoffset(self)
Returns distance into data we are
  getdata(self)
Returns the data passed in
  getnextbyte(self)
Returns next byte
  getnextbytes(self, howmany)
Returns howmany bytes
  getremainingbytes(self)
Returns rest of buffer
  getvalue(self)
Returns the buffer being built
  hasmore(self)
Is there any data left?
  howmuchmore(self)
Returns how many bytes left
  peeknextbyte(self, howmuch)
Returns value of next byte, but doesn't advance position
  peeknextbytes(self, howmany)
  setcurrentoffset(self, ofs)
Set the current offset
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
  offset: Returns distance into data we are

Method Details

__init__(self, data=None)
(Constructor)

Call with data to read from it, or with None to write to it
Overrides:
__builtin__.object.__init__

appendbyte(self, val)

Appends byte to data.
Parameters:
val - a number 0 <= val <=255

appendbytes(self, bytes)

Adds bytes to end

getcurrentoffset(self)

Returns distance into data we are

getdata(self)

Returns the data passed in

getnextbyte(self)

Returns next byte

getnextbytes(self, howmany)

Returns howmany bytes

getremainingbytes(self)

Returns rest of buffer

getvalue(self)

Returns the buffer being built

hasmore(self)

Is there any data left?

howmuchmore(self)

Returns how many bytes left

peeknextbyte(self, howmuch=0)

Returns value of next byte, but doesn't advance position

setcurrentoffset(self, ofs)

Set the current offset

Property Details

offset

Returns distance into data we are
Get Method:
getcurrentoffset(self)
Set Method:
setcurrentoffset(self, ofs)

Generated by Epydoc 2.1 on Fri Aug 15 18:58:26 2008 http://epydoc.sf.net