TotalDepth.util.FileBuffer (Look-ahead File Buffer)

Provides a ‘look ahead’ file buffer where the caller can inspect bytes ahead of the current position.

Created on Oct 26, 2011

exception TotalDepth.util.FileBuffer.ExceptionFileBuffer

Specialisation of Exception for the FileBuffer module.

__weakref__

list of weak references to the object (if defined)

exception TotalDepth.util.FileBuffer.ExceptionFileBufferEOF

Specialisation of Exception for the FileBuffer EOF.

class TotalDepth.util.FileBuffer.FileBuffer(f)

Provides a buffer interface to a file where the user can look ahead any distance from the current position.

__init__(f)

Initialize self. See help(type(self)) for accurate signature.

tell()

Current file position.

step()

Increment the file position by one byte, returns the byte just read.

__getitem__(i)

Get an arbitrary byte or slice.

__weakref__

list of weak references to the object (if defined)