Ejemplo n.º 1
0
        public FileStreamContext(string filename, FileOpenModeEnum openMode, FileAccessEnum access, int bufferSize = 0)
        {
            FileName = filename;

            if (bufferSize == 0)
            {
                _underlyingStream = new FileStream(filename,
                                                   FileStreamsManager.ConvertFileOpenModeToCLR(openMode),
                                                   FileStreamsManager.ConvertFileAccessToCLR(access));
            }
            else
            {
                _underlyingStream = new FileStream(filename,
                                                   FileStreamsManager.ConvertFileOpenModeToCLR(openMode),
                                                   FileStreamsManager.ConvertFileAccessToCLR(access),
                                                   FileShare.Read,
                                                   bufferSize);
            }

            _commonImpl = new GenericStreamImpl(_underlyingStream);
        }
Ejemplo n.º 2
0
 public GenericStream(Stream underlyingStream, bool readOnly)
 {
     _underlyingStream = underlyingStream;
     _commonImpl       = new GenericStreamImpl(_underlyingStream);
     _isReadOnly       = readOnly;
 }
Ejemplo n.º 3
0
 public GenericStream(Stream underlyingStream)
 {
     _underlyingStream = underlyingStream;
     _commonImpl       = new GenericStreamImpl(_underlyingStream);
     _isReadOnly       = false;
 }
Ejemplo n.º 4
0
 public FileStreamContext(string fileName, FileStream openedStream)
 {
     FileName          = fileName;
     _underlyingStream = openedStream;
     _commonImpl       = new GenericStreamImpl(_underlyingStream);
 }
Ejemplo n.º 5
0
 MemoryStreamContext(int capacity)
 {
     _underlyingStream = new MemoryStream(capacity);
     _commonImpl       = new GenericStreamImpl(_underlyingStream);
 }
Ejemplo n.º 6
0
 MemoryStreamContext(BinaryDataBuffer bytes)
 {
     _underlyingStream      = new MemoryStream(bytes.Bytes);
     _shouldBeCopiedOnClose = !bytes.ReadOnly;
     _commonImpl            = new GenericStreamImpl(_underlyingStream);
 }
Ejemplo n.º 7
0
 MemoryStreamContext()
 {
     _underlyingStream = new MemoryStream();
     _commonImpl       = new GenericStreamImpl(_underlyingStream);
 }