package com.cartrack.cartrackble

import android.content.Context
import java.nio.charset.Charset

fun Context.loadJSONFromAsset(fileName: String):String {
    val inputStream = this.assets.open(fileName)
    val size = inputStream.available()
    val buffer = ByteArray(size)
    inputStream.read(buffer)
    inputStream.close()
    return buffer.toString(Charset.defaultCharset())
}