 
     static func byteOrderMarkLength(header: Slice<UnsafeBufferPointer<UInt8>>) -> Int {
         guard let prefix = prefixFromHeader(header),
-            bomLength = encodingFromBOM(prefix).length else {
+            bomLength = encodingFromBOM(prefix)?.length else {
             return 0
         }
         return bomLength

        case(0xFF, 0xFE, _, _):
            return (.UTF16LE, 2)
        default:
            return (nil, nil)
        }
    }
}

        return nil
    }

    private static func encodingFromBOM(prefix: EncodingBytePrefix) -> (encoding: Encoding, length: Int)? {
        switch prefix {
        case(0xFE, 0xFF, _, _):
            return (.UTF16BE, 2)
