Skip to content

MimeDetector

Abhinav Dhiman edited this page Sep 11, 2020 · 1 revision

MimeDetector

public struct MimeDetector

Initializers

init(data:​)

public init(data:​ Data)

init(bytes:​)

public init(bytes:[UInt8])

Methods

mimeType(data:​)

A static method to get the MimeType that matches the given file data

static public func mimeType(data:​ Data) -> MimeType?

Returns

Optional

mimeType(bytes:​)

A static method to get the MimeType that matches the given bytes

static public func mimeType(bytes:[UInt8]) -> MimeType?

Returns

Optional

mimeType(mimeDetector:​)

Get the MimeType that matches the given MimeDetector instance

static public func mimeType(mimeDetector:​ MimeDetector) -> MimeType?

Returns

Optional

readBytes(count:​)

Read bytes from file data

public func readBytes(count:​ Int) -> [UInt8]

Parameters

  • count:​ - count:​ Number of bytes to be read

Returns

Bytes represented with [UInt8]