changed writeBlock() method, now it works with BASE64Encoder