All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mdoc.internal.livereload.Resources.scala Maven / Gradle / Ivy

There is a newer version: 2.2.24
Show newest version
package mdoc.internal.livereload

import java.nio.charset.StandardCharsets
import scala.meta.internal.io.InputStreamIO

object Resources {
  def readPath(path: String): String = {
    val is = this.getClass.getResourceAsStream(path)
    if (is == null) {
      throw new NoSuchElementException(path)
    }
    val bytes =
      try InputStreamIO.readBytes(is)
      finally is.close()
    val text = new String(bytes, StandardCharsets.UTF_8)
    text
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy