---
title: OSData
framework: driverkit
role: symbol
role_heading: Class
path: driverkit/osdata
---

# OSData

A container for untyped data.

## Declaration

```occ
class OSData;
```

## Overview

Overview OSData represents an array of bytes as a container object. OSData objects are mutable: You can add bytes to them and overwrite portions of the byte array. OSData provides no concurrency protection; it’s up to the usage context to provide any protection necessary.

## Topics

### Creating a Data Object

- [withBytes](driverkit/osdata/withbytes.md)
- [withBytesNoCopy](driverkit/osdata/withbytesnocopy.md)
- [withCapacity](driverkit/osdata/withcapacity.md)
- [withData](driverkit/osdata/withdata-9y3g.md)
- [withData](driverkit/osdata/withdata-4rd8n.md)
- [OSDataCreate](driverkit/osdatacreate.md)
- [OSDataPtr](driverkit/osdataptr.md)
- [free](driverkit/osdata/free.md)

### Getting Bytes

- [getBytesNoCopy](driverkit/osdata/getbytesnocopy-91vcg.md)
- [getBytesNoCopy](driverkit/osdata/getbytesnocopy-53puz.md)
- [OSDataGetBytes](driverkit/osdatagetbytes.md)
- [OSDataGetBytesPtr](driverkit/osdatagetbytesptr.md)

### Appending Data to the Object

- [appendBytes](driverkit/osdata/appendbytes-lbqa.md)
- [appendBytes](driverkit/osdata/appendbytes-38hs5.md)
- [appendBytes](driverkit/osdata/appendbytes-lbqa.md)
- [OSDataAppendBytes](driverkit/osdataappendbytes.md)

### Inspecting a Data Object

- [getCapacity](driverkit/osdata/getcapacity.md)
- [getLength](driverkit/osdata/getlength.md)
- [OSDataGetLength](driverkit/osdatagetlength.md)

### Comparing Data Objects

- [isEqualTo](driverkit/osdata/isequalto-2kdml.md)
- [isEqualTo](driverkit/osdata/isequalto-4xz0j.md)
- [isEqualTo](driverkit/osdata/isequalto-5ssf5.md)
- [isEqualTo](driverkit/osdata/isequalto-79gqy.md)

## Relationships

### Inherits From

- [OSContainer](driverkit/oscontainer.md)

## See Also

### Registry data types

- [OSArray](driverkit/osarray.md)
- [OSDictionary](driverkit/osdictionary.md)
- [OSBoolean](driverkit/osboolean.md)
- [OSNumber](driverkit/osnumber.md)
- [OSString](driverkit/osstring.md)
- [OSSerialization](driverkit/osserialization.md)
- [OSCollection](driverkit/oscollection.md)
- [OSContainer](driverkit/oscontainer.md)
- [OSObject](driverkit/osobject.md)
- [OSSymbol](driverkit/ossymbol.md)
- [IOFixed](driverkit/iofixed.md)
