You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C# High-level library for byte manipulation, and fast encode/decode of datas
Usage
Namespace
usingByteBolt;// default: Writer, Reader
usingByteBolt.Core;// internal usage
Accepted Types
TYPE
VALUE
Byte
byte, byte[]
Char
char, string
Int16
short, ushort
Int32
int, uint
Int64
long, ulong
Floating-Point
float, double
Writer
usingSystem;usingByteBolt;// import to use: Writer, ReaderusingByteBolt.Core;// import to use: Segment, Encode [ ASCII, UTF7, UTF8, UTF32, UNICODE ]// create instanceWriterw=newWriter();// default;/*Writer w = new Writer(int <length>); // set default Segment lengthWriter w = bew Writer(Segment <segment>); // set existent Segment */// writew.Write("ByteBolt",Encode.UTF8);// Write string with (Encode), the default is UTF8. w.Write("int, string, byte[], char, float, double, ...");// encoded resultbyte[]array=w.ToArray();Segmentsegment=w.ToSegment();
Reader
usingSystem;usingByteBolt;// create instanceReaderr=newReader(refw);// default;/*Reader r = new Reader(byte[] <buffer>); // set BufferReader r = new Reader(Writer <writer>); // set WriterReader r = bew Reader(Segment <segment>); // set Segment */// readerbytemyByte=r.ReadByte();stringmyString=r.ReadString();stringmyStrName=r.ReadString(Encode.UTF8);// Reader string with (Encode), the default is UTF8.// otherbytepeekIndex=r.Peek();// peek current reading indexbytepeekMyIndex=r.Peek(7);// peek at custom segment indexintcurrent=r.Current;// get the current reading indexintlength=r.Length;// get the reader Segment length// Seek: move the current reading Segment position:// Syntax: Reader.Seek(int <position>); // WARNING (use this only if you know what you're doing)r.Seek(current);