byte[] data = new byte[4]; // create a byte array to store the packet data int value; // create an integer variable to store the extracted value // assume packet data is already received and stored in the data array using (PacketReader reader = new PacketReader(data)) { value = reader.ReadInt(); // read the integer value from the packet } // value variable now contains the extracted integer value
byte[] data = new byte[16]; // create a byte array to store the packet data int[] values = new int[4]; // create an integer array to store the extracted values // assume packet data is already received and stored in the data array using (PacketReader reader = new PacketReader(data)) { // read the first 4 integer values from the packet and store them in the values array for (int i = 0; i < 4; i++) { values[i] = reader.ReadInt(); } } // values array now contains the extracted integer valuesBased on the library name, System.IO, it appears that PacketReader is a part of the default .NET framework provided by Microsoft.