Ejemplo n.º 1
0
        public object Clone()
        {
            var stream = new MemoryIOStream <T>(FCapacity);

            stream.Length = Length;
            Array.Copy(FBuffer, stream.FBuffer, stream.FBuffer.Length);
            return(stream);
        }
Ejemplo n.º 2
0
 public void Reset()
 {
     FPosition = 0;
     if (FMemoryStream != null)
     {
         FMemoryStreamWriter.Dispose();
         FMemoryStreamWriter = null;
         FMemoryStream       = null;
     }
 }
Ejemplo n.º 3
0
        public void Dispose()
        {
            if (FStreamWriter != null)
            {
                FStreamWriter.Dispose();
                FStreamWriter = null;

                if (FPosition > FStreamLength)
                {
                    // Stream is larger now
                    FStream.Append(FMemoryStream);
                    FMemoryStreamWriter.Dispose();
                    FMemoryStreamWriter = null;
                    FMemoryStream       = null;
                }
                else
                {
                    // Stream is smaller now
                    FStream.Length = FPosition;
                }
            }
        }
Ejemplo n.º 4
0
 internal StreamReader(MemoryIOStream <T> stream)
 {
     FStream = stream;
 }
Ejemplo n.º 5
0
 internal StreamWriter(MemoryIOStream <T> stream)
 {
     FStream = stream;
 }