Since you use the "old-fashioned" instruction tryand explicitly turn it into scala.util.Try, there really is no reason not to add a block finallyafter try.
, , , ByteArrayInputStream - . :
def inflate(deflatedTxt: String): Try[String] = Try {
val bytes = Base64.decodedBase64(deflatedTxt)
val zipInputStream = GZIPInputStream(new ByteArrayInputStream(bytes))
IOUtils.toString(zipInputStream)
}
bytes zipInputStream, , .
finally scala.util.Try.apply - , , map, , . andThen eventually scala.util.Try, , , (?).