internal void Write(PdbWriter writer, byte[] bytes, int data) {
      if (bytes == null || data == 0) {
        return;
      }

      int left = data;
      int used = 0;
      int rema = contentSize % writer.pageSize;
      if (rema != 0) {
        int todo = writer.pageSize - rema;
        if (todo > left) {
          todo = left;
        }

        int lastPage = pages[pages.Length - 1];
        writer.Seek(lastPage, rema);
        writer.Write(bytes, used, todo);
        used += todo;
        left -= todo;
      }

      if (left > 0) {
        int count = (left + writer.pageSize - 1) / writer.pageSize;
        int page0 = writer.AllocatePages(count);

        writer.Seek(page0, 0);
        writer.Write(bytes, used, left);

        AddPages(page0, count);
      }

      contentSize += data;
    }
Beispiel #2
0
        internal void Write(PdbWriter writer, byte[] bytes, int data)
        {
            if (bytes == null || data == 0)
            {
                return;
            }

            int left = data;
            int used = 0;
            int rema = contentSize % writer.pageSize;

            if (rema != 0)
            {
                int todo = writer.pageSize - rema;
                if (todo > left)
                {
                    todo = left;
                }

                int lastPage = pages[pages.Length - 1];
                writer.Seek(lastPage, rema);
                writer.Write(bytes, used, todo);
                used += todo;
                left -= todo;
            }

            if (left > 0)
            {
                int count = (left + writer.pageSize - 1) / writer.pageSize;
                int page0 = writer.AllocatePages(count);

                writer.Seek(page0, 0);
                writer.Write(bytes, used, left);

                AddPages(page0, count);
            }

            contentSize += data;
        }
Beispiel #3
0
 internal void Write(PdbWriter writer, byte[] bytes)
 {
     Write(writer, bytes, bytes.Length);
 }
 internal void Write(PdbWriter writer, byte[] bytes) {
   Write(writer, bytes, bytes.Length);
 }