tModLoader v2024.11
A mod to make and play Terraria mods
BinaryIO Class Reference

Static Public Member Functions

static BitsByte ReadBitsByte (this BinaryReader reader)
 
static void ReadBytes (this Stream stream, byte[] buf)
 
static byte[] ReadBytes (this Stream stream, int len)
 
static byte[] ReadBytes (this Stream stream, long len)
 
static ReadOnlySpan< byte > ReadByteSpan (this Stream stream, int len)
 
static void ReadFlags (this BinaryReader reader, out bool b0)
 
static void ReadFlags (this BinaryReader reader, out bool b0, out bool b1)
 
static void ReadFlags (this BinaryReader reader, out bool b0, out bool b1, out bool b2)
 
static void ReadFlags (this BinaryReader reader, out bool b0, out bool b1, out bool b2, out bool b3)
 
static void ReadFlags (this BinaryReader reader, out bool b0, out bool b1, out bool b2, out bool b3, out bool b4)
 
static void ReadFlags (this BinaryReader reader, out bool b0, out bool b1, out bool b2, out bool b3, out bool b4, out bool b5)
 
static void ReadFlags (this BinaryReader reader, out bool b0, out bool b1, out bool b2, out bool b3, out bool b4, out bool b5, out bool b6)
 
static void ReadFlags (this BinaryReader reader, out bool b0, out bool b1, out bool b2, out bool b3, out bool b4, out bool b5, out bool b6, out bool b7)
 Reads up to 8 bools sent as a single byte using BinaryReader.WriteFlags. This is more efficient than using BinaryReader.ReadBoolean.
 
static int ReadVarInt (this BinaryReader reader)
 
static void SafeRead (this BinaryReader reader, Action< BinaryReader > read)
 
static void SafeWrite (this BinaryWriter writer, Action< BinaryWriter > write)
 
static MemoryStream ToMemoryStream (this byte[] bytes, bool writeable=false)
 
static void Write (this BinaryWriter writer, bool b1=false, bool b2=false, bool b3=false, bool b4=false, bool b5=false, bool b6=false, bool b7=false, bool b8=false)
 
static void WriteFlags (this BinaryWriter writer, bool b1=false, bool b2=false, bool b3=false, bool b4=false, bool b5=false, bool b6=false, bool b7=false, bool b8=false)
 Efficiently writes up to 8 bools as a single byte. To read, use BinaryReader.ReadFlags. This is more efficient than using BinaryWriter.Write(bool).
 
static void WriteVarInt (this BinaryWriter writer, int value)