<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>MgByteSink ToFile method?</title>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Andy,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Here is some sample code:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color="#003366"
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:#003366'>&nbsp;&nbsp;&nbsp;
MgByteSource byteSource = new MgByteSource(&#8220;Testing&#8221;, 7);<br>
&nbsp;&nbsp;&nbsp; byteSource.SetMimeType(&#8220;text/plain&#8221;);<br>
&nbsp;&nbsp;&nbsp; MgByteReader byteReader = byteSource.GetReader();<br>
&nbsp;&nbsp;&nbsp; MgByteSink byteSink = new MgByteSink (byteReader);<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color="#003366"
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:#003366'>&nbsp;&nbsp;&nbsp;
byteSink.ToFile(&#8220;C:\\Temp\\data.txt&#8221;);<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hope this helps.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Steve.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Andy Morsell<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 29, 2007
6:38 PM<br>
<b><span style='font-weight:bold'>To:</span></b> 'MapGuide Users Mail List'<br>
<b><span style='font-weight:bold'>Subject:</span></b> [mapguide-users]
MgByteSink ToFile method?</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>How
is the MgByteSink::ToFile method succesfully used?&nbsp; When I attempt to
utilize it in a .NET program,&nbsp; I get the following error message no matter
what I use for the path:</span></font><o:p></o:p></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>A file IO
exception occurred: test.pngA file IO exception occurred: test.png Exception
occurred in method MgByteSink.ToFile at line 220 in file
c:\build_tux_area\mgdev\common\service\data\ByteSink.cpp <o:p></o:p></span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thank
you.</span></font> <o:p></o:p></p>

<p><font size=1 face=Tahoma><span style='font-size:7.5pt;font-family:Tahoma'>Andy
Morsell, P.E.</span></font> <br>
<font size=1 face=Tahoma><span style='font-size:7.5pt;font-family:Tahoma'>Spatial
Integrators, Inc.</span></font> <br>
<a href="http://www.SpatialGIS.com"><font size=1 face=Tahoma><span
style='font-size:7.5pt;font-family:Tahoma'>http://www.SpatialGIS.com</span></font></a>
<o:p></o:p></p>

</div>

</body>

</html>