class FileOutputStream

Defined at line 120 of file ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h

A ZeroCopyOutputStream which writes to a file descriptor.

FileOutputStream is preferred over using an ofstream with

OstreamOutputStream. The latter will introduce an extra layer of buffering,

harming performance. Also, it's conceivable that FileOutputStream could

someday be enhanced to use zero-copy file descriptors on OSs which

support them.

Public Methods

void FileOutputStream (int file_descriptor, int block_size)

Creates a stream that writes to the given Unix file descriptor.

If a block_size is given, it specifies the size of the buffers

that should be returned by Next(). Otherwise, a reasonable default

is used.

void FileOutputStream (const FileOutputStream & )

Defined at line 128 of file ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h

FileOutputStream & operator= (const FileOutputStream & )

Defined at line 129 of file ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h

void ~FileOutputStream ()
bool Close ()

Flushes any buffers and closes the underlying file. Returns false if

an error occurs during the process; use GetErrno() to examine the error.

Even if an error occurs, the file descriptor is closed when this returns.

void SetCloseOnDelete (bool value)

By default, the file descriptor is not closed when the stream is

destroyed. Call SetCloseOnDelete(true) to change that. WARNING:

This leaves no way for the caller to detect if close() fails. If

detecting close() errors is important to you, you should arrange

to close the descriptor yourself.

Defined at line 143 of file ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h

int GetErrno ()

If an I/O error has occurred on this file descriptor, this is the

errno from that error. Otherwise, this is zero. Once an error

occurs, the stream is broken and all subsequent operations will

fail.

Defined at line 149 of file ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h