This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// Why bytesView rather than just extending NSData directly? | |
// Because this way we can keep our extension internal and not conflict | |
// with someone who imports us and has also extended NSData. | |
// If you're top-level code, you can just hoist everyting up to NSData directly. | |
internal extension NSData { | |
var bytesView: BytesView { return BytesView(self) } | |
} |