Easy.IO 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Easy.IO --version 1.0.0
NuGet\Install-Package Easy.IO -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Easy.IO" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Easy.IO --version 1.0.0
#r "nuget: Easy.IO, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Easy.IO as a Cake Addin
#addin nuget:?package=Easy.IO&version=1.0.0

// Install Easy.IO as a Cake Tool
#tool nuget:?package=Easy.IO&version=1.0.0

Easy.IO

Based on okio project built with .Net Standard 2.0

ByteStrings and Buffers

Easy.IO is built around two types that pack a lot of capability into a straightforward API:

  • [ByteString][3] is an immutable sequence of bytes. For character data, String is fundamental. ByteString is String's long-lost brother, making it easy to treat binary data as a value. This class is ergonomic: it knows how to encode and decode itself as hex, base64, and UTF-8.

  • [EasyBuffer][4] is a mutable sequence of bytes. Like List, you don't need to size your buffer in advance. You read and write buffers as a queue: write data to the end and read it from the front. There's no obligation to manage positions, limits, or capacities.

Internally, ByteString and EasyBuffer do some clever things to save CPU and memory. If you encode a UTF-8 string as a ByteString, it caches a reference to that string so that if you decode it later, there's no work to do.

EasyBuffer is implemented as a linked list of segments. When you move data from one buffer to another, it reassigns ownership of the segments rather than copying the data across. This approach is particularly helpful for multithreaded programs: a thread that talks to the network can exchange data with a worker thread without any copying or ceremony.

Get started

  • Read File
	string tempFile = Path.GetTempFileName();
	BufferedSource source = EasyIO.Buffer(EasyIO.Source(tempFile));
	var str = source.ReadUtf8();
	source.Dispose();
  • Write File
	string tempFile = Path.GetTempFileName();
	BufferedSink sink = EasyIO.Buffer(EasyIO.Sink(tempFile));
	sink.WriteUtf8("Hello, ");
	sink.Dispose();
  • Append File
	string tempFile = Path.GetTempFileName();
	BufferedSink sink = EasyIO.Buffer(EasyIO.Sink(tempFile, FileMode.Append));
	sink.WriteUtf8("Hello, ");
	sink.Dispose();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.0 6,316 12/14/2019
1.3.0 480 7/21/2019
1.0.0 454 7/7/2019