Convert byte array to resource java