.NET Framework Class Library  

IsolatedStorageFileStream.ReadByte Method

Reads a single byte from the IsolatedStorageFileStream in isolated storage.

[Visual Basic]
Overrides Public Function ReadByte() As Integer
[C#]
public override int ReadByte();
[C++]
public: int ReadByte();
[JScript]
public override function ReadByte() : int;

Return Value

The 8-bit unsigned integer value read from the isolated storage file.

Example

[Visual Basic, C#, C++] The following code example demonstrates how the ReadByte method can be used to read data from an IsolatedStorageFileStream. For the complete context of this example, see the IsolatedStorageFileStream overview.

[Visual Basic] 
Console.WriteLine("Writing data to the new file.")
While source.Position < source.Length
    inputChar = CByte(source.ReadByte())
    target.WriteByte(inputChar)
End While

' Determine the size of the IsolatedStorageFileStream
' by checking its Length property.
Console.WriteLine(("Total Bytes Read: " & source.Length))

[C#] 
Console.WriteLine("Writing data to the new file.");
while (source.Position < source.Length)
{
    inputChar = (byte)source.ReadByte();
    target.WriteByte(inputChar);
}

// Determine the size of the IsolatedStorageFileStream
// by checking its Length property.
Console.WriteLine("Total Bytes Read: " + source.Length);

[C++] 
Console::WriteLine("Writing data to the new file.");
while (source->Position < source->Length)
{
    inputChar = (Byte)source->ReadByte();
    target->WriteByte((Byte)source->ReadByte());
}

// Determine the size of the IsolatedStorageFileStream
// by checking its Length property.
Console::WriteLine(S"Total Bytes Read: {0}", source->Length.ToString());

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IsolatedStorageFileStream Class | IsolatedStorageFileStream Members | System.IO.IsolatedStorage Namespace