Instance Property

hasBytesAvailable

A Boolean value that indicates whether the receiver has bytes available to read.

Declaration

var hasBytesAvailable: Bool { get }

Discussion

true if the receiver has bytes available to read, otherwise false. May also return true if a read must be attempted in order to determine the availability of bytes.

See Also

Using Streams

func read(UnsafeMutablePointer<UInt8>, maxLength: Int) -> Int

Reads up to a given number of bytes into a given buffer.

func getBuffer(UnsafeMutablePointer<UnsafeMutablePointer<UInt8>?>, length: UnsafeMutablePointer<Int>) -> Bool

Returns by reference a pointer to a read buffer and, by reference, the number of bytes available, and returns a Boolean value that indicates whether the buffer is available.