@Throws(MissingObjectException::class, IOException::class, UnsupportedEncodingException::class) private fun noteToString(repo: Repository, note: Note): String? { val loader: ObjectLoader = repo.open(note.getData()) val baos = ByteArrayOutputStream() loader.copyTo(baos) return String(baos.toByteArray(), "UTF-8") }
Utility method that converts a note to a string ( assuming it 's UTF-8 ) .