CBFSStorageStream Type
Syntax
cbfsstorage.CBFSStorageStream
Remarks
The CBFSStorageStream type is returned by some of the CBDrive component's methods. All stream types in CBFS Storage share a common API, which implements multiple interfaces from Go's io package, documented below.
Properties | |
Length |
Gets or sets the length of the stream, in bytes.
func (obj *CBFSStorageStream) GetLength() (int64, error) |
Position |
Gets or sets the current position within the stream.
func (obj *CBFSStorageStream) GetPosition() (int64, error) |
Methods | |
Close |
Closes the stream. Has no effect if the stream is already closed.
func (obj *CBFSStorageStream) Close() error |
Flush |
Forces all data held by the stream's buffers to be written out to storage.
func (obj *CBFSStorageStream) Flush() error |
Read |
Reads a sequence of bytes from the stream and advances the current position within the stream by the number of bytes read.
func (obj *CBFSStorageStream) Read(p []byte) (n int, err error) Up to len(p) bytes will be read from the stream into p. Fewer than len(p) bytes may be read if fewer than len(p) bytes are available. Returns the number of bytes read in n, and any error encountered (including, but not limited to, EOF) in err. |
ReadByte |
Reads and returns the next byte from the stream or any error encountered.
func (obj *CBFSStorageStream) ReadByte() (byte, error) |
Seek |
Sets the current position within the stream based on a particular point of origin.
func (obj *CBFSStorageStream) Seek(offset int64, whence int) (int64, error) Returns the new offset relative to the start of the stream, and any error encountered. |
Write |
Writes a sequence of bytes to the stream and advances the current position within the stream by the number of bytes written.
func (obj *CBFSStorageStream) Write(p []byte) (n int, err error) Writes len(p) bytes to the stream. Returns the number of bytes written in n, and any error encountered in err. |
WriteByte |
Writes a single byte to the stream and returns any error encountered.
func (obj *CBFSStorageStream) WriteByte(c byte) error |