示例#1
0
 public PositionLessStreamWriter(IPositionLessStream stream)
 {
     _stream = stream;
     Buf     = new byte[4096];
     End     = Buf.Length;
     _ofs    = 0;
     _stream.SetSize(0);
 }
示例#2
0
 public PositionLessStreamWriter(IPositionLessStream stream)
 {
     _stream = stream;
     Buf = new byte[4096];
     End = Buf.Length;
     _ofs = 0;
     _stream.SetSize(0);
 }
 public void SetSize(ulong size)
 {
     Log("setting stream size:{0}", size);
     try
     {
         _positionLessStream.SetSize(size);
     }
     catch (Exception ex)
     {
         Log("Exception in setSize:{0}", ex.ToString());
         throw;
     }
 }
示例#4
0
 public PositionLessStreamWriter(IPositionLessStream stream, Action?onDispose, bool atEnd = false)
 {
     _stream    = stream;
     _onDispose = onDispose ?? DisposeStream;
     _buf       = new byte[BufLength];
     _pos       = 0;
     if (atEnd)
     {
         _ofs = _stream.GetSize();
     }
     else
     {
         _ofs = 0;
         _stream.SetSize(0);
     }
 }
示例#5
0
 public PositionLessStreamWriter(IPositionLessStream stream, Action onDispose, bool atEnd = false)
 {
     _stream = stream;
     if (onDispose == null) onDispose = DisposeStream;
     _onDispose = onDispose;
     Buf = new byte[8192];
     End = Buf.Length;
     if (atEnd)
     {
         _ofs = _stream.GetSize();
     }
     else
     {
         _ofs = 0;
         _stream.SetSize(0);
     }
 }
示例#6
0
 public PositionLessStreamWriter(IPositionLessStream stream, Action onDispose, bool atEnd = false)
 {
     _stream = stream;
     if (onDispose == null)
     {
         onDispose = DisposeStream;
     }
     _onDispose = onDispose;
     Buf        = new byte[8192];
     End        = Buf.Length;
     if (atEnd)
     {
         _ofs = _stream.GetSize();
     }
     else
     {
         _ofs = 0;
         _stream.SetSize(0);
     }
 }