Ejemplo n.º 1
0
        /*	private void WriteOg(ogg_page og,Stream stdout)
         *      {
         *              byte[] ogheader = new byte[og.header_len];
         *              Marshal.Copy(og.header,ogheader,0,og.header_len);
         *              stdout.Write(ogheader,0,og.header_len);
         *              byte[] ogbody = new byte[og.body_len];
         *              Marshal.Copy(og.body,ogbody,0,og.body_len);
         *              stdout.Write(ogbody,0,og.body_len);
         *      }
         */
        private void WriteOg(IntPtr ogptr, Stream stdout)
        {
            ogg_page og = new ogg_page();

            //Marshal.PtrToStructure(ogptr,og);
            og.header     = Marshal.ReadIntPtr(ogptr);
            og.header_len = Marshal.ReadInt32(ogptr, 4);
            og.body       = Marshal.ReadIntPtr(ogptr, 8);
            og.body_len   = Marshal.ReadInt32(ogptr, 12);

            byte[] ogheader = new byte[og.header_len];
            Marshal.Copy(og.header, ogheader, 0, og.header_len);
            stdout.Write(ogheader, 0, og.header_len);
            byte[] ogbody = new byte[og.body_len];
            Marshal.Copy(og.body, ogbody, 0, og.body_len);
            stdout.Write(ogbody, 0, og.body_len);
        }
Ejemplo n.º 2
0
		/*	private void WriteOg(ogg_page og,Stream stdout)
			{
				byte[] ogheader = new byte[og.header_len];
				Marshal.Copy(og.header,ogheader,0,og.header_len);
				stdout.Write(ogheader,0,og.header_len);
				byte[] ogbody = new byte[og.body_len];				
				Marshal.Copy(og.body,ogbody,0,og.body_len);
				stdout.Write(ogbody,0,og.body_len);
			}
		*/
		private void WriteOg(IntPtr ogptr,Stream stdout)
		{
			ogg_page og = new ogg_page();
			//Marshal.PtrToStructure(ogptr,og);
			og.header = Marshal.ReadIntPtr(ogptr);
			og.header_len = Marshal.ReadInt32(ogptr,4);
			og.body = Marshal.ReadIntPtr(ogptr,8);
			og.body_len = Marshal.ReadInt32(ogptr,12);

			byte[] ogheader = new byte[og.header_len];
			Marshal.Copy(og.header,ogheader,0,og.header_len);
			stdout.Write(ogheader,0,og.header_len);
			byte[] ogbody = new byte[og.body_len];				
			Marshal.Copy(og.body,ogbody,0,og.body_len);
			stdout.Write(ogbody,0,og.body_len);
		}