ヽ三・w・三ノ Base64エンコーディングをするときは・・・
3バイト区切りで!
3バイト区切りで!
バイナリを読むときに3バイト区切りで読み込まないと、
途中に"="が入ってるダメな感じの子にナッチャウヨー
StreamWriter writer = new StreamWriter(filePath); using (datFile) using (writer) { BinaryReader reader = new BinaryReader(datFile); // 3の倍数で分割すると途中でパディングされない // 36KBで分割 byte[] buffer = new byte[36864]; long remain = datFile.Length; int readBytes = 0; while (0 < remain) { readBytes = reader.Read(buffer, 0, (int)Math.Min(buffer.Length, remain)); String contentString = Convert.ToBase64String(buffer, 0, readBytes); contentStringLength += contentString.Length; writer.Write(contentString); remain -= readBytes; } reader.Close(); }