středa 25. března 2015

Release 1.0.0

Base64Stream is a free .NET library for Base64 stream encoding/decoding on Windows Phone 8.1 and Windows 8.1 Store Apps.

Current version provides only "single-line" encoding and decoding. Although this does not cause any problems during encoding, it will result in corrupted output when you try to decode wrapped Base64 data (e.g. 64 characters per line). I am aware of this limitation and will do my best to fix it ASAP.
Also no options are available at the moment, but hopefully will be added soon.

You can use Base64Stream library for stream encoding in following way:

private async void EncodeFile()
{
  StorageFile input = await ApplicationData.Current.LocalFolder.GetFileAsync("document.txt");
  Stream instream = await input.OpenStreamForReadAsync();

  StorageFile output = await ApplicationData.Current.LocalFolder.CreateFile("base64.txt", CreationCollisionOptions.ReplaceExisting);
  Stream outstream = await output.OpenStreamForWriteAsync();

  int nWritten = await NuGet_Base64Stream.Encode(instream, outstream);

  await outstream.FlushAsync();
  outstream.Dispose();
  instream.Dispose();
}

Decoding goes the same way using Decode function.

Both functions return number of bytes written to the output stream.

Žádné komentáře:

Okomentovat