// ObjectListEntry { // Flags { // Fxxxxxxx ObjectIDIncluded // xxxxxxFF ObjectType (Data,Stream,Link,Directory) // } // String name // // Permissions permissions // switch(ObjectType) { // case Data { // if(ObjectIDIncluded) { // Varint id // } // } case Stream { // if(ObjectIDIncluded) { // Varint id // } // } case Link { // } case Directory { // if(ObjectIDIncluded) { // Varint id // } // } // } // } public static UInt32 Serialize(this ObjectEntry[] entries, Buf sendBuffer, UInt32 offset) { UInt32 sizeOffset = offset; sendBuffer.EnsureCapacityCopyData(offset + 4); offset += 4; for (int i = 0; i < entries.Length; i++) { ObjectEntry entry = entries[i]; offset = entry.Serialize(sendBuffer, offset); } UInt32 length = offset - sizeOffset - 4; sendBuffer.array.BigEndianSetUInt32(sizeOffset, length); return(offset); }
public void GenerateRandom(Byte[] bytes, int offset, int length) { buffer.EnsureCapacityCopyData(length); }
public void Add(Byte[] data) { buffer.EnsureCapacityCopyData(this.dataOffsetLimit + (UInt32)data.Length); ArrayCopier.Copy(data, 0, buffer.array, this.dataOffsetLimit, data.Length); this.dataOffsetLimit += (UInt32)data.Length; }
public void Add(Byte[] bytes, Int32 length) { buffer.EnsureCapacityCopyData(count + length); Array.Copy(bytes, 0, buffer.array, count, length); count += length; }