public static void Converts_Text() { var text = "Hello World!"; var bytes = DataConvert.TextToBytes(text); Assert.Equal( text, DataConvert.BytesToText(bytes)); }
public static void Cat(CatOptions o) { var snapshotStore = CreateSnapshotStore(o.Repository); if (string.IsNullOrEmpty(o.Export)) { using var stream = new MemoryStream(); snapshotStore.RetrieveContent(o.ContentUris, stream); Console.WriteLine( DataConvert.BytesToText(stream.ToArray())); } else { using var stream = new FileStream( o.Export, FileMode.CreateNew, FileAccess.Write); snapshotStore.RetrieveContent(o.ContentUris, stream); } }