public class IsolatedStorageFileStream : FileStream
|
Since this class extends FileStream, you can use an instance of IsolatedStorageFileStream in most situations where a FileStream might otherwise be used, such as to construct a StreamReader or StreamWriter.
ctor #1 | Overloaded:.ctor(string path, FileMode mode) Initializes a new instance of an IsolatedStorageFileStream object giving access to the file designated by path in the specified mode. |
ctor #2 | Overloaded:.ctor(string path, FileMode mode, FileAccess access) Initializes a new instance of an IsolatedStorageFileStream object giving access to the file designated by path in the specified mode, with the kind of access requested. |
ctor #3 | Overloaded:.ctor(string path, FileMode mode, IsolatedStorageFile isf) |
ctor #4 | Overloaded:.ctor(string path, FileMode mode, FileAccess access, FileShare share) Initializes a new instance of an IsolatedStorageFileStream object giving access to the file designated by path, in the specified mode, with the specified file access, using the file sharing mode specified by share. |
ctor #5 | Overloaded:.ctor(string path, FileMode mode, FileAccess access, IsolatedStorageFile isf) |
ctor #6 | Overloaded:.ctor(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize) Initializes a new instance of an IsolatedStorageFileStream object giving access to the file designated by path, in the specified mode, with the specified file access, using the file sharing mode specified by share, with the buffersize specified. |
ctor #7 | Overloaded:.ctor(string path, FileMode mode, FileAccess access, FileShare share, IsolatedStorageFile isf) |
ctor #8 | Overloaded:.ctor(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, IsolatedStorageFile isf) Initializes a new instance of an IsolatedStorageFileStream object giving access to the file designated by path, in the specified mode, with the specified file access, using the file sharing mode specified by share, with the buffersize specified, and in the context of the IsolatedStorageFile specified by isf. |
CanRead | Read-only Overridden: Gets a Boolean value indicating whether the file can be read. |
CanSeek | Read-only Overridden: Gets a Boolean value indicating whether seek operations are supported. |
CanWrite | Read-only Overridden: Gets a Boolean value indicating whether you can write to the file. |
Handle | Read-only Overridden: Gets the file handle for the file that the current IsolatedStorageFileStream object encapsulates. |
IsAsync | Read-only Overridden: Gets a Boolean value indicating whether the IsolatedStorageFileStream was opened asynchronously or synchronously. |
Length | Read-only Overridden: Gets the length of the IsolatedStorageFileStream. |
Name (inherited from System.IO.FileStream) |
Read-only See base class member description: System.IO.FileStream.Name Gets the name of the FileStream that was passed to the constructor. |
Position | Read-write Overridden: Gets or sets the current position of this IsolatedStorageFileStream to the specified value. |
BeginRead | Overridden: Begins an asynchronous read. |
BeginWrite | Overridden: Begins an asynchronous write. |
Close | Overridden: Releases resources associated with the IsolatedStorageFileStream. |
CreateObjRef (inherited from System.MarshalByRefObject) |
See base class member description: System.MarshalByRefObject.CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. |
EndRead | Overridden: Ends a pending asynchronous read request. |
EndWrite | Overridden: Ends an asynchronous write. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
Flush | Overridden: Updates the file with the current state of the buffer then clears the buffer. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetLifetimeService (inherited from System.MarshalByRefObject) |
See base class member description: System.MarshalByRefObject.GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
InitializeLifetimeService (inherited from System.MarshalByRefObject) |
See base class member description: System.MarshalByRefObject.InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. |
Lock (inherited from System.IO.FileStream) |
See base class member description: System.IO.FileStream.Lock Prevents access by other processes to all or part of a file. |
Read | Overridden: Copies bytes from the current buffered IsolatedStorageFileStream to an array. |
ReadByte | Overridden: Reads a single byte from the IsolatedStorageFileStream in isolated storage. |
Seek | Overridden: Sets the current position of this IsolatedStorageFileStream to the specified value. |
SetLength | Overridden: Sets the length of this IsolatedStorageFileStream to the specified value. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
Unlock (inherited from System.IO.FileStream) |
See base class member description: System.IO.FileStream.Unlock Allows access by other processes to all or part of a file that was previously locked. |
Write | Overridden: Writes a block of bytes to the IsolatedStorageFileStream using data read from a byte array. |
WriteByte | Overridden: Writes a single byte to the IsolatedStorageFileStream. |
CreateWaitHandle (inherited from System.IO.Stream) |
See base class member description: System.IO.Stream.CreateWaitHandle Allocates a WaitHandle object. |
Dispose | Overridden: Releases resources associated with the IsolatedStorageFileStream. |
Finalize (inherited from System.IO.FileStream) |
See base class member description: System.IO.FileStream.Finalize Ensures that resources are freed and other cleanup operations are performed when the garbage collector reclaims the FileStream. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
path
mode
Exception Type | Condition |
---|---|
ArgumentException | The path is badly formed. -or- No file was found and the mode is set to Open. |
ArgumentNullException | The path is null. |
The mode parameter indicates whether a new file should be created, an existing one used, and so on.
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable and can cause an exception to be thrown.
public IsolatedStorageFileStream( |
path
mode
access
Exception Type | Condition |
---|---|
ArgumentException | The path is badly formed. -or- No file was found and the mode is set to Open. |
ArgumentNullException | The path is null. |
The mode parameter indicates whether a new file should be created or an existing one used. The access parameter includes read-only, read/write, and write-only.
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable, and can cause an exception to be thrown.
public IsolatedStorageFileStream( |
path
mode
isf
Exception Type | Condition |
---|---|
ArgumentException | The path is badly formed. -or- No file was found and the mode is set to Open. |
ArgumentNullException | The path is null. |
public IsolatedStorageFileStream( |
path
mode
access
share
Exception Type | Condition |
---|---|
ArgumentException | The path is badly formed. -or- No file was found and the mode is set to Open. |
ArgumentNullException | The path is null. |
public IsolatedStorageFileStream( |
path
mode
access
isf
Exception Type | Condition |
---|---|
ArgumentException | The path is badly formed. -or- No file was found and the mode is set to Open. |
ArgumentNullException | The path is null. |
public IsolatedStorageFileStream( |
path
mode
access
share
bufferSize
Exception Type | Condition |
---|---|
ArgumentException | The path is badly formed. -or- No file was found and the mode is set to Open. |
ArgumentNullException | The path is null. |
The mode parameter indicates whether a new file should be created or an existing one used. The access parameter includes read-only, read/write, and write-only.
When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable, and can cause an exception to be thrown.
public IsolatedStorageFileStream( |
path
mode
access
share
isf
Exception Type | Condition |
---|---|
ArgumentException | The path is badly formed. -or- No file was found and the mode is set to Open. |
ArgumentNullException | The path is null. |
public IsolatedStorageFileStream( |
path
mode
access
share
bufferSize
isf
Exception Type | Condition |
---|---|
ArgumentException | The path is badly formed. -or- No file was found and the mode is set to Open. |
ArgumentNullException | The path is null. |
public override bool CanRead {get;}
|
public override bool CanSeek {get;}
|
public override bool CanWrite {get;}
|
public override IntPtr Handle {get;}
|
public override bool IsAsync {get;}
|
public override long Length {get;}
|
public string Name {get;}
|
public override long Position {get; set;}
|
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | The position cannot be set to a negative number. |
public override IAsyncResult BeginRead( |
buffer
offset
numBytes
userCallback
stateObject
Exception Type | Condition |
---|---|
IOException | An asynchronous read was attempted past the end of the file. |
You must call Stream.EndRead with this IAsyncResult to find out how many bytes were read.
public override IAsyncResult BeginWrite( |
buffer
offset
numBytes
userCallback
stateObject
Exception Type | Condition |
---|---|
IOException | An asynchronous write was attempted past the end of the file. |
The current position in the stream is updated when you issue the asynchronous read or write, not when the I/O operation completes.
You must call Stream.EndWrite with the IAsyncResult that this method returns to find out how many bytes were written.
public override void Close(); |
Following a call to IsolatedStorageFileStream.Close, any operations on the file stream might raise exceptions. After IsolatedStorageFileStream.Close has been called once, it does nothing if called again. The Object.Finalize method invokes IsolatedStorageFileStream.Close so the file stream is closed before the garbage collector finalizes the object.
IsolatedStorageFileStream objects require an IsolatedStorageFile that determines the storage context for the files accessed. For streams opened without passing an IsolatedStorageFile object, a default IsolatedStorageFile is created for the executing assembly and then closed during the call to IsolatedStorageFileStream.Close.
requestedType
Exception Type | Condition |
---|---|
RemotingException | This instance is not a valid remoting object. |
protected virtual WaitHandle CreateWaitHandle(); |
Use this method if you implement the asynchronous methods and require a way of blocking in Stream.EndRead or Stream.EndWrite until the asynchronous operation is complete.
protected override void Dispose( |
disposing
public override int EndRead( |
asyncResult
Exception Type | Condition |
---|---|
ArgumentNullException | The asyncResult is null. |
public override void EndWrite( |
asyncResult
Exception Type | Condition |
---|---|
ArgumentNullException | The asyncResult parameter is null. |
EndWrite will block until the I/O operation has completed.
~FileStream(); |
Exception Type | Condition |
---|---|
IOException | The handle for the file is invalid. |
public override void Flush(); |
public virtual int GetHashCode(); |
public object GetLifetimeService(); |
public Type GetType(); |
public virtual object InitializeLifetimeService(); |
public class MyClass : MarshalByRefObject { public override Object InitializeLifetimeService() { ILease lease = (ILease)base.InitializeLifetimeService(); if (lease.CurrentState == LeaseState.Initial) { lease.InitialLeaseTime = TimeSpan.FromMinutes(1); lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); lease.RenewOnCallTime = TimeSpan.FromSeconds(2); } return lease; } }
position
length
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | position or length is negative. |
IOException | An I/O error occurs, such as the file being closed or its handle being invalid. |
protected object MemberwiseClone(); |
buffer
offset
count
The Read method treats the buffer parameter as a block of bytes, regardless of its actual type. Likewise, the offset and count parameters are always specified in bytes. For buffer parameters other than byte arrays, this means that an element index must be multiplied by the element size in bytes to form a correct value for offset or count.
The Read method will return zero only if the end of the stream is reached. In all other cases, Read always reads at least one byte from the stream before returning. If no data is available from the IsolatedStorageFileStream upon a call to Read, the method will block until at least one byte of data can be returned.
public override int ReadByte(); |
public override long Seek(long offset, Seek( |
offset
origin
Exception Type | Condition |
---|---|
ArgumentException | The origin must be one of the SeekOrigin values. |
public override void SetLength( |
value
public virtual string ToString(); |
position
length
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | position or length is negative. |
buffer
offset
count
public override void WriteByte( |
value