public static void WriteList(byte[] buffer, int offset, List <FileFullEAEntry> list) { for (int index = 0; index < list.Count; index++) { FileFullEAEntry entry = list[index]; entry.WriteBytes(buffer, offset); int entryLength = entry.Length; offset += entryLength; if (index < list.Count - 1) { // When multiple FILE_FULL_EA_INFORMATION data elements are present in the buffer, each MUST be aligned on a 4-byte boundary int padding = (4 - (entryLength % 4)) % 4; offset += padding; } } }
public static List <FileFullEAEntry> ReadList(byte[] buffer, int offset) { List <FileFullEAEntry> result = new List <FileFullEAEntry>(); if (offset < buffer.Length) { FileFullEAEntry entry; do { entry = new FileFullEAEntry(buffer, offset); result.Add(entry); offset += (int)entry.NextEntryOffset; }while (entry.NextEntryOffset != 0); } return(result); }