コード例 #1
0
        public static List <FileFullEAInformation> ReadList(byte[] buffer, int offset)
        {
            List <FileFullEAInformation> result = new List <FileFullEAInformation>();
            FileFullEAInformation        entry;

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