CBFSVaultStream Type

Syntax

cbfsvault.CBFSVaultStream

Remarks

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

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

Methods

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

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

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

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

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