using Emulator.Common.IO; // Create a new instance of BigEndianWriter using (var writer = new BigEndianWriter("file.bin")) { // Write some binary data writer.Write(0x12345678); writer.Write("Hello, world!"); writer.Write(true); }
using Emulator.Common.IO; using System.Net.Sockets; // Connect to a remote server var client = new TcpClient("localhost", 1234); // Get the network stream from the client using (var stream = client.GetStream()) { // Create a new instance of BigEndianWriter var writer = new BigEndianWriter(stream); // Write some binary data to the stream writer.Write(0x12345678); writer.Write("Hello, server!"); writer.Write(false); }This example demonstrates how to write binary data to a network stream using BigEndianWriter. The client connects to a remote server on port 1234 and gets the network stream from the client. Then, it creates a new instance of BigEndianWriter using the stream and writes some binary data to it. The data is sent to the server over the network. Package library: Emulator.Common.IO