WriteBytesObject() public method

public WriteBytesObject ( byte buffer ) : void
buffer byte
return void
Exemplo n.º 1
0
        private byte[] GetBody()
        {
            ByteArray bytes = new ByteArray();

            // Write Packets Data
            for (int i = 0; i < _objects.Count; i++)
            {
                SEAObject asset = _objects[i];

                ByteArray data = new ByteArray();

                byte[] buffer = asset.Write().ToArray();

                data.WriteByte(asset.Flag);
                data.WriteTypeCode(asset.Type);

                if (asset.Named)
                    data.WriteUTF8(asset.Name);

                if (asset.Compressed)
                    buffer = Compression.Compress(buffer, compressAlgorithm);

                data.WriteBytes(buffer);

                bytes.WriteBytesObject(data.ToArray());
            }

            return bytes.ToArray();
        }