App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.api.files.file.BufferedFile Class Reference
Inheritance diagram for google.appengine.api.files.file.BufferedFile:

Public Member Functions

def __init__
 
def __enter__
 
def __exit__
 
def close
 
def tell
 
def read
 
def readline
 
def seek
 

Detailed Description

BufferedFile is a file-like object reading underlying file in chunks.

Constructor & Destructor Documentation

def google.appengine.api.files.file.BufferedFile.__init__ (   self,
  filename,
  buffer_size = _DEFAULT_BUFFER_SIZE 
)
Constructor.

Args:
  filename: the name of the file to read as string.
  buffer_size: buffer read size to use as int.

Member Function Documentation

def google.appengine.api.files.file.BufferedFile.read (   self,
  size = None 
)
Read data from RAW file.

Args:
  size: Number of bytes to read as integer. Actual number of bytes
read is always equal to size unless end if file was reached.

Returns:
  A string with data read.
def google.appengine.api.files.file.BufferedFile.readline (   self,
  size = -1 
)
Read one line delimited by '\n' from the file.

A trailing newline character is kept in the string. It may be absent when a
file ends with an incomplete line. If the size argument is non-negative,
it specifies the maximum string size (counting the newline) to return. An
empty string is returned only when EOF is encountered immediately.

Args:
  size: Maximum number of bytes to read. If not specified, readline stops
only on '\n' or EOF.

Returns:
  The data read as a string.
def google.appengine.api.files.file.BufferedFile.seek (   self,
  offset,
  whence = os.SEEK_SET 
)
Set the file's current position.

Args:
  offset: seek offset as number.
  whence: seek mode. Supported modes are os.SEEK_SET (absolute seek),
os.SEEK_CUR (seek relative to the current position), and os.SEEK_END
(seek relative to the end, offset should be negative).
def google.appengine.api.files.file.BufferedFile.tell (   self)
Return file's current position.

The documentation for this class was generated from the following file: