mirror of
https://github.com/HaishinKit/HaishinKit.swift.git
synced 2026-05-07 20:12:28 +00:00
14 lines
331 B
Swift
14 lines
331 B
Swift
import CoreMedia
|
|
import Foundation
|
|
|
|
extension Data {
|
|
var bytes: [UInt8] {
|
|
withUnsafeBytes {
|
|
guard let pointer = $0.baseAddress?.assumingMemoryBound(to: UInt8.self) else {
|
|
return []
|
|
}
|
|
return [UInt8](UnsafeBufferPointer(start: pointer, count: count))
|
|
}
|
|
}
|
|
}
|