ok come non detto
è il passaggio da memorystream che rompe... well, scrivo direttamente nel file