Removed Base 64 and useless stream closing (thanks try with resources)