Hello all<br><br>I&#39;ve removed all the operator&gt;&gt;/&lt;&lt; from SvStream and replaced with Read/Write[sal_type] functions. While fixing up the references I noticed the template&#39;d functions below:<br><br>template&lt;typename prefix&gt;<br>

rtl::OString read_lenPrefixed_uInt8s_ToOString(SvStream&amp; rStrm)<br>{<br>    prefix nUnits = 0;<br>    rStrm &gt;&gt; nUnits;<br>    return read_uInt8s_ToOString(rStrm, nUnits);<br>}<br><br>and the corresponding write function:<br>

<br>template&lt;typename prefix&gt; sal_Size write_lenPrefixed_uInt8s_FromOString(SvStream&amp; rStrm,<br>    const rtl::OString &amp;rStr)<br>{<br>    SAL_WARN_IF(rStr.getLength() &gt; std::numeric_limits&lt;prefix&gt;::max(),<br>

        &quot;tools.stream&quot;,<br>        &quot;string too long for prefix count to fit in output type&quot;);<br><br>    sal_Size nWritten = 0;<br>    prefix nUnits = std::min&lt;sal_Size&gt;(rStr.getLength(), std::numeric_limits&lt;prefix&gt;::max());<br>

    rStrm &lt;&lt; nUnits;<br>    if (rStrm.good())<br>    {<br>        nWritten += sizeof(prefix);<br>        nWritten += rStrm.Write(rStr.getStr(), nUnits);<br>    }<br>    return nWritten;<br>}<br><br>So I have a dilemma which I would appreciate advice on. In no particular order of preference here are my ideas:<br>

<br>a) Specialize the templates and call the appropriate Read/Write[sal_type] functions.<br>b) Change SvStream to have overloaded Read/WriteNumber functions of all the sal_ types.<br>c) Add the above mentioned functions along with the Read/Write[sal_type] functions to SvStream.<br>

<br>Thanks in advance<br>Keith<br><br>