Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1.             RootObject = new sol_object();
  2.             using (var v = File.OpenRead(location))
  3.             {
  4.                 BinaryReader2 br = new BinaryReader2(v);
  5.                 ///HEADER///
  6.                 br.ReadInt16();//padding
  7.                 br.ReadInt32();//file length
  8.                 br.ReadInt32();//TCSO
  9.                 br.ReadBytes(6);//padding
  10.                 RootObject.name = Encoding.ASCII.GetString(br.ReadBytes(br.ReadInt16()));//shared object name
  11.                 if (RootObject.name != "savedLines")
  12.                     throw new Exception("invalid root object");
  13.                 br.ReadInt32();//amf version, we only support 0
  14.                 ///items///
  15.                 List<sol_object> Objects = new List<sol_object>();
  16.                 while (v.Position != v.Length)
  17.                 {
  18.                     Objects.Add(readobject(br));
  19.                     br.ReadByte();
  20.                 }
  21.                 RootObject.data = Objects;
  22.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement