---
title: MEByteSource
framework: MediaExtension
role: symbol
role_heading: Class
platforms: [macOS 14.0+]
path: mediaextension/mebytesource
---

# MEByteSource

Provides read access to the data in a media asset file.

## Declaration

```swift
class MEByteSource
```

## Overview

Overview Media Toolbox passes an MEByteSource instance for the media asset’s primary file when it initializes an MEFormatReader object. The format reader may call byteSourceForRelatedFileName(_:) to request additional byte sources for related files in the same directory as the primary file.

## Topics

### Inspecting a byte source

- [fileName](mediaextension/mebytesource/filename.md)
- [fileLength](mediaextension/mebytesource/filelength.md)
- [contentType](mediaextension/mebytesource/contenttype.md)
- [relatedFileNamesInSameDirectory](mediaextension/mebytesource/relatedfilenamesinsamedirectory.md)

### Performing operations on a byte source

- [availableLength(at:)](mediaextension/mebytesource/availablelength(at:).md)
- [byteSourceForRelatedFileName(_:)](mediaextension/mebytesource/bytesourceforrelatedfilename(_:).md)
- [read(length:from:completionHandler:)](mediaextension/mebytesource/read(length:from:completionhandler:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
