예제 #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);
     }
 }