---
title: hasBytesAvailable
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/inputstream/hasbytesavailable
---

# hasBytesAvailable

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

## Declaration

```swift
var hasBytesAvailable: Bool { get }
```

## Discussion

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

- [read(_:maxLength:)](foundation/inputstream/read(_:maxlength:).md)
- [getBuffer(_:length:)](foundation/inputstream/getbuffer(_:length:).md)
