CBFSDirectStream Type

Syntax

cbfsdirect.CBFSDirectStream

Remarks

The CBFSDirectStream type is returned by some of the CBDirect component's methods. All stream types in CBFS Direct 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 *CBFSDirectStream) GetLength() (int64, error)
func (obj *CBFSDirectStream) SetLength(value int64) error
Position Gets or sets the current position within the stream.

func (obj *CBFSDirectStream) GetPosition() (int64, error)
func (obj *CBFSDirectStream) SetPosition(value int64) error

Methods

Close Closes the stream. Has no effect if the stream is already closed.

func (obj *CBFSDirectStream) Close() error
Flush Forces all data held by the stream's buffers to be written out to storage.

func (obj *CBFSDirectStream) 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 *CBFSDirectStream) 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 *CBFSDirectStream) ReadByte() (byte, error)
Seek Sets the current position within the stream based on a particular point of origin.

func (obj *CBFSDirectStream) 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 *CBFSDirectStream) 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 *CBFSDirectStream) WriteByte(c byte) error

 
 
Copyright (c) 2021 Callback Technologies, Inc. - All rights reserved.
CBFS Direct 2020 Go Edition - Version 20.0 [Build 7836]