38 template<
typename Stream >
40 ( stream_type& f,
unsigned int buffer_size )
41 : m_stream(f), m_begin(
new char[buffer_size]), m_end(m_begin+buffer_size),
51 template<
typename Stream >
63 template<
typename Stream >
67 write( reinterpret_cast<const char*>(&v),
sizeof(v) );
76 template<
typename Stream >
81 unsigned int q = std::min( n, (
unsigned int)(m_end - m_current) );
82 const char* end = p+q;
84 for ( ; p!=end ; ++p, ++m_current )
89 if (m_current == m_end)
98 template<
typename Stream >
101 if (m_current != m_begin)
103 m_stream.write( m_begin, m_current - m_begin );