1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058
|
<?xml version="1.0" encoding="utf-8"?>
<Type Name="FileStream" FullName="System.IO.FileStream" FullNameSP="System_IO_FileStream" Maintainer="ecma">
<TypeSignature Language="ILASM" Value=".class public FileStream extends System.IO.Stream" />
<TypeSignature Language="C#" Value="public class FileStream : System.IO.Stream" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit FileStream extends System.IO.Stream" />
<MemberOfLibrary>BCL</MemberOfLibrary>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
<Base>
<BaseTypeName>System.IO.Stream</BaseTypeName>
</Base>
<Interfaces>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<example>
<para>The following example demonstrates the use of a <see cref="T:System.IO.FileStream" />
object.</para>
<code lang="C#">using System;
using System.IO;
class Directory {
public static void Main(String[] args) {
FileStream fs = new FileStream("log.txt", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter w = new StreamWriter(fs);
w.BaseStream.Seek(0, SeekOrigin.End); // Set the file pointer to the end.
Log ("Test1", w);
Log ("Test2", w);
w.Close(); // Close the writer and underlying file.
fs = new FileStream("log.txt", FileMode.OpenOrCreate, FileAccess.Read);
StreamReader r = new StreamReader(fs);
r.BaseStream.Seek(0, SeekOrigin.Begin);
DumpLog (r);
}
public static void Log (String logMessage, StreamWriter w) {
w.Write("Log Entry : ");
w.WriteLine("{0} {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
w.WriteLine(":");
w.WriteLine(":{0}", logMessage);
w.WriteLine ("-------------------------------");
w.Flush();
}
public static void DumpLog (StreamReader r) {
while (r.Peek() > -1) { // While not at the end of the file, write to standard output.
Console.WriteLine(r.ReadLine());
}
r.Close();
}
}
</code>
<para>Some example output is </para>
<c>
<para>Log Entry : 9:26:21 AM Friday, July 06, 2001</para>
<para>:</para>
<para>:Test1</para>
<para>-------------------------------</para>
<para>Log Entry : 9:26:21 AM Friday, July 06, 2001</para>
<para>:</para>
<para>:Test2</para>
<para>-------------------------------</para>
</c>
</example>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use the <see cref="T:System.IO.FileStream" /> class to read from, write to, open, and close files on a file system, and to manipulate other file-related operating system handles, including pipes, standard input, and standard output. You can use the <see cref="M:System.IO.FileStream.Read(System.Byte[],System.Int32,System.Int32)" />, <see cref="M:System.IO.FileStream.Write(System.Byte[],System.Int32,System.Int32)" />, <see cref="M:System.IO.Stream.CopyTo(System.IO.Stream)" />, and <see cref="M:System.IO.FileStream.Flush" /> methods to perform synchronous operations, or the <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.Stream.CopyToAsync(System.IO.Stream)" />, and <see cref="M:System.IO.FileStream.FlushAsync(System.Threading.CancellationToken)" /> methods to perform asynchronous operations. Use the asynchronous methods to perform resource-intensive file operations without blocking the main thread. This performance consideration is particularly important in a win8_appname_long app or desktop_appname app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. <see cref="T:System.IO.FileStream" /> buffers input and output for better performance.</para>
<para>The <see cref="P:System.IO.FileStream.IsAsync" /> property detects whether the file handle was opened asynchronously. You specify this value when you create an instance of the <see cref="T:System.IO.FileStream" /> class using a constructor that has an <paramref name="isAsync" />, <paramref name="useAsync" />, or <paramref name="options" /> parameter. When the property is true, the stream utilizes overlapped I/O to perform file operations asynchronously. However, the <see cref="P:System.IO.FileStream.IsAsync" /> property does not have to be true to call the <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, or <see cref="M:System.IO.Stream.CopyToAsync(System.IO.Stream)" /> method. When the <see cref="P:System.IO.FileStream.IsAsync" /> property is false and you call the asynchronous read and write operations, the UI thread is still not blocked, but the actual I/O operation is performed synchronously.</para>
<para>The <see cref="M:System.IO.FileStream.Seek(System.Int64,System.IO.SeekOrigin)" /> method supports random access to files. <see cref="M:System.IO.FileStream.Seek(System.Int64,System.IO.SeekOrigin)" /> allows the read/write position to be moved to any position within the file. This is done with byte offset reference point parameters. The byte offset is relative to the seek reference point, which can be the beginning, the current position, or the end of the underlying file, as represented by the three members of the <see cref="T:System.IO.SeekOrigin" /> enumeration.</para>
<block subset="none" type="note">
<para>Disk files always support random access. At the time of construction, the <see cref="P:System.IO.FileStream.CanSeek" /> property value is set to true or false depending on the underlying file type.If the underlying file type is FILE_TYPE_DISK, as defined in winbase.h, the <see cref="P:System.IO.FileStream.CanSeek" /> property value is true. Otherwise, the <see cref="P:System.IO.FileStream.CanSeek" /> property value is false.</para>
</block>
<para>If a process terminates with part of a file locked or closes a file that has outstanding locks, the behavior is undefined.</para>
<para>For directory operations and other file operations, see the <see cref="T:System.IO.File" />, <see cref="T:System.IO.Directory" />, and <see cref="T:System.IO.Path" /> classes. The <see cref="T:System.IO.File" /> class is a utility class that has static methods primarily for the creation of <see cref="T:System.IO.FileStream" /> objects based on file paths. The <see cref="T:System.IO.MemoryStream" /> class creates a stream from a byte array and is similar to the <see cref="T:System.IO.FileStream" /> class.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
<format type="text/html">
<h2>Detection of Stream Position Changes</h2>
</format>
<para>When a <see cref="T:System.IO.FileStream" /> object does not have an exclusive hold on its handle, another thread could access the file handle concurrently and change the position of the operating system's file pointer that is associated with the file handle. In this case, the cached position in the <see cref="T:System.IO.FileStream" /> object and the cached data in the buffer could be compromised. The <see cref="T:System.IO.FileStream" /> object routinely performs checks on methods that access the cached buffer to ensure that the operating system's handle position is the same as the cached position used by the <see cref="T:System.IO.FileStream" /> object.</para>
<para>If an unexpected change in the handle position is detected in a call to the <see cref="M:System.IO.FileStream.Read(System.Byte[],System.Int32,System.Int32)" /> method, the .NET Framework discards the contents of the buffer and reads the stream from the file again. This can affect performance, depending on the size of the file and any other processes that could affect the position of the file stream.</para>
<para>If an unexpected change in the handle position is detected in a call to the <see cref="M:System.IO.FileStream.Write(System.Byte[],System.Int32,System.Int32)" /> method, the contents of the buffer are discarded and an <see cref="T:System.IO.IOException" /> exception is thrown.</para>
<para>A <see cref="T:System.IO.FileStream" /> object will not have an exclusive hold on its handle when either the <see cref="P:System.IO.FileStream.SafeFileHandle" /> property is accessed to expose the handle or the <see cref="T:System.IO.FileStream" /> object is given the <see cref="P:System.IO.FileStream.SafeFileHandle" /> property in its constructor.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Exposes a <see cref="T:System.IO.Stream" /> around a file, supporting both synchronous and asynchronous read and write operations.</para>
</summary>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Microsoft.Win32.SafeHandles.SafeFileHandle handle, valuetype System.IO.FileAccess access) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="handle" Type="Microsoft.Win32.SafeHandles.SafeFileHandle" />
<Parameter Name="access" Type="System.IO.FileAccess" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When <see cref="M:System.IO.Stream.Close" /> is called, the handle is also closed and the file's handle count is decremented.</para>
<para>FileStream assumes that it has exclusive control over the handle. Reading, writing, or seeking while a FileStream is also holding a handle could result in data corruption. For data safety, call <see cref="M:System.IO.FileStream.Flush" /> before using the handle, and avoid calling any methods other than Close after you are done using the handle.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class for the specified file handle, with the specified read/write permission. </para>
</summary>
<param name="handle">
<attribution license="cc4" from="Microsoft" modified="false" />A file handle for the file that the current FileStream object will encapsulate. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that sets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. </param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (IntPtr handle, System.IO.FileAccess access);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int handle, valuetype System.IO.FileAccess access) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Obsolete("Use FileStream(SafeFileHandle handle, FileAccess access) instead")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="handle" Type="System.IntPtr" />
<Parameter Name="access" Type="System.IO.FileAccess" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When <see cref="M:System.IO.Stream.Close" /> is called, the handle is also closed and the file's handle count is decremented.</para>
<para>FileStream assumes that it has exclusive control over the handle. Reading, writing, or seeking while a FileStream is also holding a handle could result in data corruption. For data safety, call <see cref="M:System.IO.FileStream.Flush" /> before using the handle, and avoid calling any methods other than Close after you are done using the handle.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class for the specified file handle, with the specified read/write permission.</para>
</summary>
<param name="handle">
<attribution license="cc4" from="Microsoft" modified="false" />A file handle for the file that the current FileStream object will encapsulate. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that sets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. </param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(string path, valuetype System.IO.FileMode mode)" />
<MemberSignature Language="C#" Value="public FileStream (string path, System.IO.FileMode mode);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string path, valuetype System.IO.FileMode mode) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="mode" Type="System.IO.FileMode" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentException">
<paramref name="path " />is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception>
<exception cref="T:System.IO.FileNotFoundException">
<para>
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Truncate" /> or <see cref="F:System.IO.FileMode.Open" />, but the specified file cannot be found. If a different mode is specified and the file cannot be found, a new one is created.</para>
</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred, such as specifying <see cref="F:System.IO.FileMode.CreateNew" /> when the file specified by <paramref name="path" /> already exists.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The directory information specified in <paramref name="path" /> does not exist.</exception>
<exception cref="T:System.IO.PathTooLongException">The length of <paramref name="path" /> or the absolute path information for <paramref name="path " />exceeds the system-defined maximum length. </exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<para>
<paramref name="mode" /> contains an invalid value. </para>
</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">Requires permission to read, write, and append to files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" qualify="true" />, <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" qualify="true" />, and <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Append" qualify="true" />.</permission>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\\.\PHYSICALDRIVE0 ".</para>
<para>The <paramref name="path" /> parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.</para>
<para>The constructor is given read/write access to the file, and it is opened sharing Read access (that is, requests to open the file for writing by this or another process will fail until the FileStream object has been closed, but read attempts will succeed). The buffer size is set to the default size of 4096 bytes (4 KB).</para>
<block subset="none" type="note">
<para>
<paramref name="path" /> is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.</para>
</block>
<para>
<see cref="P:System.IO.Stream.CanSeek" /> is true for all <see cref="T:System.IO.FileStream" /> objects that encapsulate files. If <paramref name="path" /> indicates a device that does not support seeking, the <see cref="P:System.IO.FileStream.CanSeek" /> property on the resulting <see cref="T:System.IO.FileStream" /> is false. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<para>For constructors without a <see cref="T:System.IO.FileAccess" /> parameter, if the <paramref name="mode" /> parameter is set to <see cref="F:System.IO.FileMode.Append" />, <see cref="F:System.IO.FileAccess.Write" /> is the default access. Otherwise, the access is set to <see cref="F:System.IO.FileAccess.ReadWrite" />.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class with the specified path and creation mode.</para>
</summary>
<param name="path">
<attribution license="cc4" from="Microsoft" modified="false" />A relative or absolute path for the file that the current FileStream object will encapsulate. </param>
<param name="mode">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how to open or create the file. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access, int bufferSize);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Microsoft.Win32.SafeHandles.SafeFileHandle handle, valuetype System.IO.FileAccess access, int32 bufferSize) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="handle" Type="Microsoft.Win32.SafeHandles.SafeFileHandle" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="bufferSize" Type="System.Int32" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>FileStream assumes that it has exclusive control over the handle. Reading, writing, or seeking while a FileStream is also holding a handle could result in data corruption. For data safety, call <see cref="M:System.IO.FileStream.Flush" /> before using the handle, and avoid calling any methods other than Close after you are done using the handle. Alternately, read and write to the handle before calling this FileStream constructor.</para>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class for the specified file handle, with the specified read/write permission, and buffer size.</para>
</summary>
<param name="handle">
<attribution license="cc4" from="Microsoft" modified="false" />A file handle for the file that the current FileStream object will encapsulate. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.IO.FileAccess" /> constant that gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. </param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes.</param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (IntPtr handle, System.IO.FileAccess access, bool ownsHandle);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int handle, valuetype System.IO.FileAccess access, bool ownsHandle) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Obsolete("Use FileStream(SafeFileHandle handle, FileAccess access) instead")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="handle" Type="System.IntPtr" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="ownsHandle" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The FileStream object is given the specified access to the file. The ownership of the handle will be as specified. If this process owns the handle, a call to the <see cref="M:System.IO.Stream.Close" /> method will also close the handle and the file's handle count is decremented. The FileStream object is given the default buffer size of 8192 bytes.</para>
<para>FileStream assumes that it has exclusive control over the handle. Reading, writing, or seeking while a FileStream is also holding a handle could result in data corruption. For data safety, call <see cref="M:System.IO.FileStream.Flush" /> before using the handle, and avoid calling methods other than Close after you are done using the handle.</para>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class for the specified file handle, with the specified read/write permission and FileStream instance ownership.</para>
</summary>
<param name="handle">
<attribution license="cc4" from="Microsoft" modified="false" />A file handle for the file that the current FileStream object will encapsulate. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. </param>
<param name="ownsHandle">
<attribution license="cc4" from="Microsoft" modified="false" />true if the file handle will be owned by this FileStream instance; otherwise, false. </param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access)" />
<MemberSignature Language="C#" Value="public FileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="mode" Type="System.IO.FileMode" />
<Parameter Name="access" Type="System.IO.FileAccess" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="path " />is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.</para>
<para>-or-</para>
<para>
<paramref name="access " /> specified <see langword="Read" /> and <paramref name="mode" /> specified <see langword="Create" /> , <see langword="CreateNew" /> , <see langword="Truncate" /> or <see langword="Append" />.</para>
</exception>
<exception cref="T:System.IO.FileNotFoundException">
<para>
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Truncate" /> or <see cref="F:System.IO.FileMode.Open" /> , but the specified file was not found. If a different mode is specified and the file was not found, a new one is created.</para>
</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred, such as specifying <see cref="F:System.IO.FileMode.CreateNew" /> when the file specified by <paramref name="path" /> already exists.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The directory information specified by <paramref name="path" /> does not exist.</exception>
<exception cref="T:System.UnauthorizedAccessException">
<paramref name="path" /> specified a read-only file and <paramref name="access" /> is not <see langword="Read" /> , or <paramref name="path" /> specified a directory.</exception>
<exception cref="T:System.IO.PathTooLongException">The length of <paramref name="path" /> or the absolute path information for <paramref name="path " />exceeds the system-defined maximum length. </exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<para>
<paramref name="mode" /> or <paramref name="access" /> contain an invalid value. </para>
</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">Requires permission to read, write, and append to files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" qualify="true" />, <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" qualify="true" />, and <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Append" qualify="true" />.</permission>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\\.\PHYSICALDRIVE0 ".</para>
<para>The <paramref name="path" /> parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.</para>
<para>The constructor is given read/write access to the file, and it is opened sharing Read access (that is, requests to open the file for writing by this or another process will fail until the FileStream object has been closed, but read attempts will succeed). The buffer size is set to the default size of 8192 bytes (8 KB).</para>
<block subset="none" type="note">
<para>
<paramref name="path" /> is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.</para>
</block>
<para>
<see cref="P:System.IO.Stream.CanSeek" /> is true for all <see cref="T:System.IO.FileStream" /> objects that encapsulate files. If <paramref name="path" /> indicates a device that does not support seeking, the <see cref="P:System.IO.FileStream.CanSeek" /> property on the resulting <see cref="T:System.IO.FileStream" /> is false. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class with the specified path, creation mode, and read/write permission.</para>
</summary>
<param name="path">
<attribution license="cc4" from="Microsoft" modified="false" />A relative or absolute path for the file that the current FileStream object will encapsulate. </param>
<param name="mode">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how to open or create the file. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file can be accessed by the FileStream object. This gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. <see cref="P:System.IO.FileStream.CanSeek" /> is true if <paramref name="path" /> specifies a disk file. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access, int bufferSize, bool isAsync);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Microsoft.Win32.SafeHandles.SafeFileHandle handle, valuetype System.IO.FileAccess access, int32 bufferSize, bool isAsync) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="handle" Type="Microsoft.Win32.SafeHandles.SafeFileHandle" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="bufferSize" Type="System.Int32" />
<Parameter Name="isAsync" Type="System.Boolean" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>You set the <paramref name="isAsync" /> parameter to true to open the file handle asynchronously. When the parameter is true, the stream utilizes overlapped I/O to perform file operations asynchronously. However, the parameter does not have to be true to call the <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, or <see cref="M:System.IO.Stream.CopyToAsync(System.IO.Stream)" /> method. When the <paramref name="isAsync" /> parameter is false and you call the asynchronous read and write operations, the UI thread is still not blocked, but the actual I/O operation is performed synchronously.</para>
<para>FileStream assumes that it has exclusive control over the handle. Reading, writing, or seeking while a FileStream is also holding a handle could result in data corruption. For data safety, call <see cref="M:System.IO.FileStream.Flush" /> before using the handle, and avoid calling any methods other than Close after you are done using the handle. Alternately, read and write to the handle before calling this FileStream constructor.</para>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class for the specified file handle, with the specified read/write permission, buffer size, and synchronous or asynchronous state.</para>
</summary>
<param name="handle">
<attribution license="cc4" from="Microsoft" modified="false" />A file handle for the file that this FileStream object will encapsulate. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. </param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes.</param>
<param name="isAsync">
<attribution license="cc4" from="Microsoft" modified="false" />true if the handle was opened asynchronously (that is, in overlapped I/O mode); otherwise, false. </param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (IntPtr handle, System.IO.FileAccess access, bool ownsHandle, int bufferSize);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int handle, valuetype System.IO.FileAccess access, bool ownsHandle, int32 bufferSize) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Obsolete("Use FileStream(SafeFileHandle handle, FileAccess access, int bufferSize) instead")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="handle" Type="System.IntPtr" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="ownsHandle" Type="System.Boolean" />
<Parameter Name="bufferSize" Type="System.Int32" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The FileStream object is given the specified access to the file. The ownership of the handle will be as specified. If this FileStream owns the handle, a call to the <see cref="M:System.IO.Stream.Close" /> method will also close the handle. In particular, the file's handle count is decremented. The FileStream object is given the specified buffer size.</para>
<para>FileStream assumes that it has exclusive control over the handle. Reading, writing, or seeking while a FileStream is also holding a handle could result in data corruption. For data safety, call <see cref="M:System.IO.FileStream.Flush" /> before using the handle, and avoid calling any methods other than Close after you are done using the handle. Alternately, read and write to the handle before calling this FileStream constructor.</para>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class for the specified file handle, with the specified read/write permission, FileStream instance ownership, and buffer size.</para>
</summary>
<param name="handle">
<attribution license="cc4" from="Microsoft" modified="false" />A file handle for the file that this FileStream object will encapsulate. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. </param>
<param name="ownsHandle">
<attribution license="cc4" from="Microsoft" modified="false" />true if the file handle will be owned by this FileStream instance; otherwise, false. </param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes.</param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access, valuetype System.IO.FileShare share)" />
<MemberSignature Language="C#" Value="public FileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access, valuetype System.IO.FileShare share) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="mode" Type="System.IO.FileMode" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="share" Type="System.IO.FileShare" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="path " />is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.</exception>
<exception cref="T:System.IO.FileNotFoundException">
<para>
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Truncate" /> or <see cref="F:System.IO.FileMode.Open" /> , but the specified file cannot be found. If a different mode is specified and the file cannot be found, a new one is created.</para>
</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred, such as specifying <see cref="F:System.IO.FileMode.CreateNew" /> and the file specified by <paramref name="path" /> already exists.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The directory information specified by <paramref name="path" /> does not exist.</exception>
<exception cref="T:System.UnauthorizedAccessException">The <paramref name="access" /> requested is not permitted by the operating system for the specified <paramref name="path" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The length of <paramref name="path" /> or the absolute path information for <paramref name="path " />exceeds the system-defined maximum length. </exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<para>
<paramref name="mode" />, <paramref name="access" />, or <paramref name="share " />contains an invalid value. </para>
</exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">Requires permission to read, write, and append to files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" qualify="true" />, <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" qualify="true" />, and <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Append" qualify="true" />.</permission>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\\.\PHYSICALDRIVE0 ".</para>
<para>The <paramref name="path" /> parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.</para>
<para>The constructor is given read/write access to the file, and it is opened sharing Read access (that is, requests to open the file for writing by this or another process will fail until the FileStream object has been closed, but read attempts will succeed). The buffer size is set to the default size of 8192 bytes (8 KB).</para>
<block subset="none" type="note">
<para>
<paramref name="path" /> is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.</para>
</block>
<para>
<see cref="P:System.IO.Stream.CanSeek" /> is true for all <see cref="T:System.IO.FileStream" /> objects that encapsulate files. If <paramref name="path" /> indicates a device that does not support seeking, the <see cref="P:System.IO.FileStream.CanSeek" /> property on the resulting <see cref="T:System.IO.FileStream" /> is false. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class with the specified path, creation mode, read/write permission, and sharing permission.</para>
</summary>
<param name="path">
<attribution license="cc4" from="Microsoft" modified="false" />A relative or absolute path for the file that the current FileStream object will encapsulate. </param>
<param name="mode">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how to open or create the file. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file can be accessed by the FileStream object. This gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. <see cref="P:System.IO.FileStream.CanSeek" /> is true if <paramref name="path" /> specifies a disk file. </param>
<param name="share">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file will be shared by processes. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (IntPtr handle, System.IO.FileAccess access, bool ownsHandle, int bufferSize, bool isAsync);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int handle, valuetype System.IO.FileAccess access, bool ownsHandle, int32 bufferSize, bool isAsync) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Obsolete("Use FileStream(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync) instead")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="handle" Type="System.IntPtr" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="ownsHandle" Type="System.Boolean" />
<Parameter Name="bufferSize" Type="System.Int32" />
<Parameter Name="isAsync" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The FileStream object is given the specified access to the file. The ownership of the handle will be as specified. If this FileStream owns the handle, a call to the <see cref="M:System.IO.Stream.Close" /> method will also close the handle. In particular, the file's handle count is decremented. The FileStream object is given the specified buffer size.</para>
<para>FileStream assumes that it has exclusive control over the handle. Reading, writing, or seeking while a FileStream is also holding a handle could result in data corruption. For data safety, call <see cref="M:System.IO.FileStream.Flush" /> before using the handle, and avoid calling any methods other than Close after you are done using the handle. Alternately, read and write to the handle before calling this FileStream constructor.</para>
<para>FileShare.Read is the default for those <see cref="T:System.IO.FileStream" /> constructors without a FileShare parameter.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class for the specified file handle, with the specified read/write permission, FileStream instance ownership, buffer size, and synchronous or asynchronous state.</para>
</summary>
<param name="handle">
<attribution license="cc4" from="Microsoft" modified="false" />A file handle for the file that this FileStream object will encapsulate. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. </param>
<param name="ownsHandle">
<attribution license="cc4" from="Microsoft" modified="false" />true if the file handle will be owned by this FileStream instance; otherwise, false. </param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes.</param>
<param name="isAsync">
<attribution license="cc4" from="Microsoft" modified="false" />true if the handle was opened asynchronously (that is, in overlapped I/O mode); otherwise, false. </param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access, valuetype System.IO.FileShare share, int32 bufferSize)" />
<MemberSignature Language="C#" Value="public FileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access, valuetype System.IO.FileShare share, int32 bufferSize) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="mode" Type="System.IO.FileMode" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="share" Type="System.IO.FileShare" />
<Parameter Name="bufferSize" Type="System.Int32" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">The <paramref name="path" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="path " />is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<para>
<paramref name="bufferSize" /> is less than or equal to zero.</para>
<para>-or-</para>
<para>
<paramref name="mode" />, <paramref name="access" />, or <paramref name="share " />contain an invalid value.</para>
</exception>
<exception cref="T:System.IO.FileNotFoundException">
<para>
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Truncate" /> or <see cref="F:System.IO.FileMode.Open" /> , but the specified file cannot be found. If a different mode is specified and the file cannot be found, a new one is created.</para>
</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred, such as specifying <see cref="F:System.IO.FileMode.CreateNew" /> and the file specified by <paramref name="path" /> already exists.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The directory information specified in <paramref name="path" /> does not exist.</exception>
<exception cref="T:System.UnauthorizedAccessException">The <paramref name="access" /> requested is not permitted by the operating system for the specified <paramref name="path" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The length of <paramref name="path" /> or the absolute path information for <paramref name="path " />exceeds the system-defined maximum length. </exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">Requires permission to read, write, and append to files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" qualify="true" />, <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" qualify="true" />, and <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Append" qualify="true" />.</permission>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\\.\PHYSICALDRIVE0 ".</para>
<para>The <paramref name="path" /> parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.</para>
<block subset="none" type="note">
<para>
<paramref name="path" /> is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.</para>
</block>
<para>
<see cref="P:System.IO.Stream.CanSeek" /> is true for all <see cref="T:System.IO.FileStream" /> objects that encapsulate files. If <paramref name="path" /> indicates a device that does not support seeking, the <see cref="P:System.IO.FileStream.CanSeek" /> property on the resulting <see cref="T:System.IO.FileStream" /> is false. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class with the specified path, creation mode, read/write and sharing permission, and buffer size.</para>
</summary>
<param name="path">
<attribution license="cc4" from="Microsoft" modified="false" />A relative or absolute path for the file that the current FileStream object will encapsulate. </param>
<param name="mode">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how to open or create the file. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file can be accessed by the FileStream object. This gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. <see cref="P:System.IO.FileStream.CanSeek" /> is true if <paramref name="path" /> specifies a disk file. </param>
<param name="share">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file will be shared by processes. </param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access, valuetype System.IO.FileShare share, int32 bufferSize, bool useAsync)" />
<MemberSignature Language="C#" Value="public FileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, bool useAsync);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access, valuetype System.IO.FileShare share, int32 bufferSize, bool useAsync) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue />
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="mode" Type="System.IO.FileMode" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="share" Type="System.IO.FileShare" />
<Parameter Name="bufferSize" Type="System.Int32" />
<Parameter Name="useAsync" Type="System.Boolean" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">
<paramref name="path" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="path " />is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<para>
<paramref name="bufferSize" /> is less than or equal to zero.</para>
<para>-or-</para>
<para>
<paramref name="mode" />, <paramref name="access" />, or <paramref name="share " />contain an invalid value.</para>
</exception>
<exception cref="T:System.IO.FileNotFoundException">
<para>
<paramref name="mode" /> is <see cref="F:System.IO.FileMode.Truncate" /> or <see cref="F:System.IO.FileMode.Open" />, but the specified file cannot be found. If a different mode is specified and the file cannot be found, a new one is created.</para>
</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred, such as specifying <see cref="F:System.IO.FileMode.CreateNew" /> and the file specified by <paramref name="path" /> already exists.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The directory information specified by <paramref name="path" /> does not exist.</exception>
<exception cref="T:System.UnauthorizedAccessException">The <paramref name="access" /> requested is not permitted by the operating system for the specified <paramref name="path" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The length of <paramref name="path" /> or the absolute path information for <paramref name="path " />exceeds the system-defined maximum length. </exception>
<permission cref="T:System.Security.Permissions.FileIOPermission">Requires permission to read, write, and append to files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" qualify="true" />, <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" qualify="true" />, and <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Append" qualify="true" />.</permission>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\\.\PHYSICALDRIVE0 ".</para>
<para>The <paramref name="path" /> parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.</para>
<block subset="none" type="note">
<para>
<paramref name="path" /> is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.</para>
</block>
<para>
<see cref="P:System.IO.Stream.CanSeek" /> is true for all <see cref="T:System.IO.FileStream" /> objects that encapsulate files. If <paramref name="path" /> indicates a device that does not support seeking, the <see cref="P:System.IO.FileStream.CanSeek" /> property on the resulting <see cref="T:System.IO.FileStream" /> is false. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class with the specified path, creation mode, read/write and sharing permission, buffer size, and synchronous or asynchronous state.</para>
</summary>
<param name="path">
<attribution license="cc4" from="Microsoft" modified="false" />A relative or absolute path for the file that the current FileStream object will encapsulate. </param>
<param name="mode">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how to open or create the file. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file can be accessed by the FileStream object. This gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. <see cref="P:System.IO.FileStream.CanSeek" /> is true if <paramref name="path" /> specifies a disk file. </param>
<param name="share">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file will be shared by processes. </param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes. </param>
<param name="useAsync">
<attribution license="cc4" from="Microsoft" modified="false" />Specifies whether to use asynchronous I/O or synchronous I/O. However, note that the underlying operating system might not support asynchronous I/O, so when specifying true, the handle might be opened synchronously depending on the platform. When opened asynchronously, the <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> and <see cref="M:System.IO.FileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> methods perform better on large reads or writes, but they might be much slower for small reads or writes. If the application is designed to take advantage of asynchronous I/O, set the <paramref name="useAsync" /> parameter to true. Using asynchronous I/O correctly can speed up applications by as much as a factor of 10, but using it without redesigning the application for asynchronous I/O can decrease performance by as much as a factor of 10. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, System.IO.FileOptions options);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.IO.FileAccess access, valuetype System.IO.FileShare share, int32 bufferSize, valuetype System.IO.FileOptions options) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="mode" Type="System.IO.FileMode" />
<Parameter Name="access" Type="System.IO.FileAccess" />
<Parameter Name="share" Type="System.IO.FileShare" />
<Parameter Name="bufferSize" Type="System.Int32" />
<Parameter Name="options" Type="System.IO.FileOptions" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\\.\PHYSICALDRIVE0 ".</para>
<para>The <paramref name="fileOptions" /> parameter is used to provide access to more advanced operations that can be leveraged when creating a <see cref="T:System.IO.FileStream" /> object.</para>
<para>The <paramref name="path" /> parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.</para>
<block subset="none" type="note">
<para>
<paramref name="path" /> is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.</para>
</block>
<para>
<see cref="P:System.IO.Stream.CanSeek" /> is true for all <see cref="T:System.IO.FileStream" /> objects that encapsulate files. If <paramref name="path" /> indicates a device that does not support seeking, the <see cref="P:System.IO.FileStream.CanSeek" /> property on the resulting <see cref="T:System.IO.FileStream" /> is false. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class with the specified path, creation mode, read/write and sharing permission, the access other FileStreams can have to the same file, the buffer size, and additional file options.</para>
</summary>
<param name="path">
<attribution license="cc4" from="Microsoft" modified="false" />A relative or absolute path for the file that the current FileStream object will encapsulate. </param>
<param name="mode">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how to open or create the file. </param>
<param name="access">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file can be accessed by the FileStream object. This gets the <see cref="P:System.IO.FileStream.CanRead" /> and <see cref="P:System.IO.FileStream.CanWrite" /> properties of the FileStream object. <see cref="P:System.IO.FileStream.CanSeek" /> is true if <paramref name="path" /> specifies a disk file. </param>
<param name="share">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file will be shared by processes. </param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes. </param>
<param name="options">
<attribution license="cc4" from="Microsoft" modified="false" />A value that specifies additional file options.</param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (string path, System.IO.FileMode mode, System.Security.AccessControl.FileSystemRights rights, System.IO.FileShare share, int bufferSize, System.IO.FileOptions options);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.Security.AccessControl.FileSystemRights rights, valuetype System.IO.FileShare share, int32 bufferSize, valuetype System.IO.FileOptions options) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="mode" Type="System.IO.FileMode" />
<Parameter Name="rights" Type="System.Security.AccessControl.FileSystemRights" />
<Parameter Name="share" Type="System.IO.FileShare" />
<Parameter Name="bufferSize" Type="System.Int32" />
<Parameter Name="options" Type="System.IO.FileOptions" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\\.\PHYSICALDRIVE0 ".</para>
<para>Use this <see cref="M:System.IO.FileStream.#ctor(System.String,System.IO.FileMode,System.Security.AccessControl.FileSystemRights,System.IO.FileShare,System.Int32,System.IO.FileOptions)" /> constructor to apply access rights at the point of creation of a file. To access or modify rights on an existing file, consider using the <see cref="M:System.IO.File.GetAccessControl(System.String)" /> and <see cref="M:System.IO.File.SetAccessControl(System.String,System.Security.AccessControl.FileSecurity)" /> methods.</para>
<para>The <paramref name="fileOptions" /> parameter is used to provide access to more advanced operations that can be leveraged when creating a <see cref="T:System.IO.FileStream" /> object.</para>
<para>The <paramref name="path" /> parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.</para>
<block subset="none" type="note">
<para>
<paramref name="path" /> is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.</para>
</block>
<para>
<see cref="P:System.IO.Stream.CanSeek" /> is true for all <see cref="T:System.IO.FileStream" /> objects that encapsulate files. If <paramref name="path" /> indicates a device that does not support seeking, the <see cref="P:System.IO.FileStream.CanSeek" /> property on the resulting <see cref="T:System.IO.FileStream" /> is false. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class with the specified path, creation mode, access rights and sharing permission, the buffer size, and additional file options.</para>
</summary>
<param name="path">
<attribution license="cc4" from="Microsoft" modified="false" />A relative or absolute path for the file that the current <see cref="T:System.IO.FileStream" /> object will encapsulate.</param>
<param name="mode">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how to open or create the file.</param>
<param name="rights">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines the access rights to use when creating access and audit rules for the file.</param>
<param name="share">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file will be shared by processes.</param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes.</param>
<param name="options">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that specifies additional file options.</param>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileStream (string path, System.IO.FileMode mode, System.Security.AccessControl.FileSystemRights rights, System.IO.FileShare share, int bufferSize, System.IO.FileOptions options, System.Security.AccessControl.FileSecurity fileSecurity);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string path, valuetype System.IO.FileMode mode, valuetype System.Security.AccessControl.FileSystemRights rights, valuetype System.IO.FileShare share, int32 bufferSize, valuetype System.IO.FileOptions options, class System.Security.AccessControl.FileSecurity fileSecurity) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="path" Type="System.String" />
<Parameter Name="mode" Type="System.IO.FileMode" />
<Parameter Name="rights" Type="System.Security.AccessControl.FileSystemRights" />
<Parameter Name="share" Type="System.IO.FileShare" />
<Parameter Name="bufferSize" Type="System.Int32" />
<Parameter Name="options" Type="System.IO.FileOptions" />
<Parameter Name="fileSecurity" Type="System.Security.AccessControl.FileSecurity" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The .NET Framework does not support direct access to physical disks through paths that are device names, such as "\\.\PHYSICALDRIVE0 ".</para>
<para>Use this <see cref="M:System.IO.FileStream.#ctor(System.String,System.IO.FileMode,System.Security.AccessControl.FileSystemRights,System.IO.FileShare,System.Int32,System.IO.FileOptions,System.Security.AccessControl.FileSecurity)" /> constructor to apply access rights at the point of creation of a file. To access or modify rights on an existing file, consider using the <see cref="M:System.IO.File.GetAccessControl(System.String)" /> and <see cref="M:System.IO.File.SetAccessControl(System.String,System.Security.AccessControl.FileSecurity)" /> methods.</para>
<para>The <paramref name="fileOptions" /> parameter is used to provide access to more advanced operations that can be leveraged when creating a <see cref="T:System.IO.FileStream" /> object.</para>
<para>The <paramref name="path" /> parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.</para>
<block subset="none" type="note">
<para>
<paramref name="path" /> is not required to be a file stored on disk; it can be any part of a system that supports access through streams. For example, depending on the system, this class can access a physical device.</para>
</block>
<para>
<see cref="P:System.IO.Stream.CanSeek" /> is true for all <see cref="T:System.IO.FileStream" /> objects that encapsulate files. If <paramref name="path" /> indicates a device that does not support seeking, the <see cref="P:System.IO.FileStream.CanSeek" /> property on the resulting <see cref="T:System.IO.FileStream" /> is false. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
<block subset="none" type="note">
<para>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 could cause an exception to be thrown.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Initializes a new instance of the <see cref="T:System.IO.FileStream" /> class with the specified path, creation mode, access rights and sharing permission, the buffer size, additional file options, access control and audit security.</para>
</summary>
<param name="path">
<attribution license="cc4" from="Microsoft" modified="false" />A relative or absolute path for the file that the current <see cref="T:System.IO.FileStream" /> object will encapsulate.</param>
<param name="mode">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how to open or create the file.</param>
<param name="rights">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines the access rights to use when creating access and audit rules for the file.</param>
<param name="share">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines how the file will be shared by processes.</param>
<param name="bufferSize">
<attribution license="cc4" from="Microsoft" modified="false" />A positive <see cref="T:System.Int32" /> value greater than 0 indicating the buffer size. For <paramref name="bufferSize" /> values between one and eight, the actual buffer size is set to eight bytes.</param>
<param name="options">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that specifies additional file options.</param>
<param name="fileSecurity">
<attribution license="cc4" from="Microsoft" modified="false" />A constant that determines the access control and audit security for the file.</param>
</Docs>
</Member>
<Member MemberName="BeginRead">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.IAsyncResult BeginRead(class System.Byte[] array, int32 offset, int32 numBytes, class System.AsyncCallback userCallback, object stateObject)" />
<MemberSignature Language="C#" Value="public override IAsyncResult BeginRead (byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.IAsyncResult BeginRead(unsigned int8[] array, int32 offset, int32 numBytes, class System.AsyncCallback userCallback, object stateObject) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="System.Byte[]" />
<Parameter Name="offset" Type="System.Int32" />
<Parameter Name="numBytes" Type="System.Int32" />
<Parameter Name="userCallback" Type="System.AsyncCallback" />
<Parameter Name="stateObject" Type="System.Object" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentException">The sum of <paramref name="offset and" /><paramref name="numBytes" /> is greater than the length of <paramref name="array" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="array" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="offset" /> or <paramref name="numBytes" /> is negative. </exception>
<exception cref="T:System.IO.IOException">The asynchronous read operation attempted to read past the end of the file.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>In the .NET Framework 4 and earlier versions, you have to use methods such as <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> and <see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" /> to implement asynchronous file operations. These methods are still available in the net_v45 to support legacy code; however, the new async methods, such as <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.Stream.CopyToAsync(System.IO.Stream)" />, and <see cref="M:System.IO.FileStream.FlushAsync(System.Threading.CancellationToken)" />, help you implement asynchronous file operations more easily.</para>
<para>
<see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" /> must be called exactly once for every call to <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />. Failing to end a read process before beginning another read can cause undesirable behavior such as deadlock.</para>
<para>
<see cref="T:System.IO.FileStream" /> provides two different modes of operation: synchronous I/O and asynchronous I/O. While either can be used, the underlying operating system resources might allow access in only one of these modes. By default, <see cref="T:System.IO.FileStream" /> opens the operating system handle synchronously. In Windows, this slows down asynchronous methods. If asynchronous methods are used, use the <see cref="M:System.IO.FileStream.#ctor(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,System.Int32,System.Boolean)" /> constructor.</para>
<block subset="none" type="note">
<para>Use the <see cref="P:System.IO.FileStream.CanRead" /> property to determine whether the current instance supports reading. For additional information, see <see cref="P:System.IO.Stream.CanRead" />.</para>
</block>
<para>If a stream is closed or you pass an invalid argument, exceptions are thrown immediately from <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />. Errors that occur during an asynchronous read request, such as a disk failure during the IO request, occur on the thread pool thread and become visible upon a call to <see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" />.</para>
<para>
<see cref="M:System.IO.Stream.EndRead(System.IAsyncResult)" /> must be called with this <see cref="T:System.IAsyncResult" /> to find out how many bytes were read.</para>
<para>Multiple simultaneous asynchronous requests render the request completion order uncertain.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Begins an asynchronous read operation. (Consider using <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" /> instead; see the Remarks section.)</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An object that references the asynchronous read.</para>
</returns>
<param name="array">
<attribution license="cc4" from="Microsoft" modified="false" />The buffer to read data into. </param>
<param name="offset">
<attribution license="cc4" from="Microsoft" modified="false" />The byte offset in <paramref name="array" /> at which to begin reading. </param>
<param name="numBytes">
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of bytes to read. </param>
<param name="userCallback">
<attribution license="cc4" from="Microsoft" modified="false" />The method to be called when the asynchronous read operation is completed. </param>
<param name="stateObject">
<attribution license="cc4" from="Microsoft" modified="false" />A user-provided object that distinguishes this particular asynchronous read request from other requests. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="BeginWrite">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.IAsyncResult BeginWrite(class System.Byte[] array, int32 offset, int32 numBytes, class System.AsyncCallback userCallback, object stateObject)" />
<MemberSignature Language="C#" Value="public override IAsyncResult BeginWrite (byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.IAsyncResult BeginWrite(unsigned int8[] array, int32 offset, int32 numBytes, class System.AsyncCallback userCallback, object stateObject) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="System.Byte[]" />
<Parameter Name="offset" Type="System.Int32" />
<Parameter Name="numBytes" Type="System.Int32" />
<Parameter Name="userCallback" Type="System.AsyncCallback" />
<Parameter Name="stateObject" Type="System.Object" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentException">The sum of <paramref name="offset and " /><paramref name="numBytes" /> is greater than the length of <paramref name="array" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="array" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="offset" /> or <paramref name="numBytes" /> is negative.</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<exception cref="T:System.SystemNotSupportedException">The stream does not support writing. </exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>In the .NET Framework 4 and earlier versions, you have to use methods such as <see cref="M:System.IO.FileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> and <see cref="M:System.IO.FileStream.EndWrite(System.IAsyncResult)" /> to implement asynchronous file operations. These methods are still available in the net_v45 to support legacy code; however, the new async methods, such as <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.Stream.CopyToAsync(System.IO.Stream)" />, and <see cref="M:System.IO.FileStream.FlushAsync(System.Threading.CancellationToken)" />, help you implement asynchronous file operations more easily.</para>
<para>
<see cref="M:System.IO.FileStream.EndWrite(System.IAsyncResult)" /> must be called exactly once on every <see cref="T:System.IAsyncResult" /> from <see cref="M:System.IO.FileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />. <see cref="M:System.IO.FileStream.EndWrite(System.IAsyncResult)" /> will block until the I/O operation has completed.</para>
<para>This method overrides <see cref="M:System.IO.Stream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />.</para>
<para>
<see cref="T:System.IO.FileStream" /> provides two different modes of operation: synchronous I/O and asynchronous I/O. While either can be used, the underlying operating system resources might allow access in only one of these modes. By default, <see cref="T:System.IO.FileStream" /> opens the operating system handle synchronously. In Windows, this slows down asynchronous methods. If asynchronous methods are used, use the <see cref="M:System.IO.FileStream.#ctor(System.String,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,System.Int32,System.Boolean)" /> constructor.</para>
<para>If a stream is closed or you pass an invalid argument, exceptions are thrown immediately from <see cref="M:System.IO.FileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />. Errors that occur during an asynchronous write request, such as a disk failure during the IO request, occur on the thread pool thread and become visible upon a call to <see cref="M:System.IO.FileStream.EndWrite(System.IAsyncResult)" />.</para>
<para>Multiple simultaneous asynchronous requests render the request completion order uncertain.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Begins an asynchronous write operation. (Consider using <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" /> instead; see the Remarks section.)</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An object that references the asynchronous write.</para>
</returns>
<param name="array">
<attribution license="cc4" from="Microsoft" modified="false" />The buffer containing data to write to the current stream.</param>
<param name="offset">
<attribution license="cc4" from="Microsoft" modified="false" />The zero-based byte offset in <paramref name="array" /> at which to begin copying bytes to the current stream.</param>
<param name="numBytes">
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of bytes to write. </param>
<param name="userCallback">
<attribution license="cc4" from="Microsoft" modified="false" />The method to be called when the asynchronous write operation is completed. </param>
<param name="stateObject">
<attribution license="cc4" from="Microsoft" modified="false" />A user-provided object that distinguishes this particular asynchronous write request from other requests. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="CanRead">
<MemberSignature Language="ILASM" Value=".property bool CanRead { public hidebysig virtual specialname bool get_CanRead() }" />
<MemberSignature Language="C#" Value="public override bool CanRead { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CanRead" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>
<para>
<see langword="true" /> if the stream supports reading;
<see langword="false" /> if the stream is
closed or was opened with write-only
access.</para>
</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>If a class derived from <see cref="T:System.IO.Stream" /> does not support reading, calls to the <see cref="M:System.IO.FileStream.Read(System.Byte[],System.Int32,System.Int32)" />, <see cref="M:System.IO.FileStream.ReadByte" />, and <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> methods throw a <see cref="T:System.NotSupportedException" />.</para>
<para>If the stream is closed, this property returns false.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a value indicating whether the current stream supports reading.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="CanSeek">
<MemberSignature Language="ILASM" Value=".property bool CanSeek { public hidebysig virtual specialname bool get_CanSeek() }" />
<MemberSignature Language="C#" Value="public override bool CanSeek { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CanSeek" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>
<para>
<see langword="true" /> if the stream supports seeking;
<see langword="false" /> if the stream is
closed or if the <see cref="T:System.IO.FileStream" /> was constructed from an
operating-system handle such as a pipe or output to the console.</para>
</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>If a class derived from <see cref="T:System.IO.Stream" /> does not support seeking, calls to <see cref="P:System.IO.FileStream.Length" />, <see cref="M:System.IO.FileStream.SetLength(System.Int64)" />, <see cref="P:System.IO.FileStream.Position" />, and <see cref="M:System.IO.FileStream.Seek(System.Int64,System.IO.SeekOrigin)" /> throw a <see cref="T:System.NotSupportedException" />.</para>
<para>If the stream is closed, this property returns false.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a value indicating whether the current stream supports seeking.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="CanWrite">
<MemberSignature Language="ILASM" Value=".property bool CanWrite { public hidebysig virtual specialname bool get_CanWrite() }" />
<MemberSignature Language="C#" Value="public override bool CanWrite { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CanWrite" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>
<para>
<see langword="true" /> if the stream supports writing;
<see langword="false" /> if the stream is
closed or was opened with read-only access.</para>
</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>If a class derived from <see cref="T:System.IO.Stream" /> does not support writing, a call to <see cref="M:System.IO.FileStream.SetLength(System.Int64)" />, <see cref="M:System.IO.FileStream.Write(System.Byte[],System.Int32,System.Int32)" />, <see cref="M:System.IO.FileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />, or <see cref="M:System.IO.FileStream.WriteByte(System.Byte)" /> throws a <see cref="T:System.NotSupportedException" />.</para>
<para>If the stream is closed, this property returns false.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a value indicating whether the current stream supports writing.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Close">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void Close()" />
<MemberSignature Language="C#" Value="public override void Close ();" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para>Closes the file and releases any resources associated with
the current file stream.</para>
</summary>
<remarks>
<para>This method is
equivalent to <see cref="M:System.IO.FileStream.Dispose(System.Boolean)" />(<see langword="true" />).</para>
<para>Any data previously written to the buffer is copied to the file
before the file stream is closed, so it is not necessary to call <see cref="M:System.IO.FileStream.Flush" /> before
invoking <see langword="Close" />. Following a call to <see langword="Close" />, any operations on the file stream
might raise exceptions. Invoking this method on the
same instance multiple times does not result in an exception.</para>
<para>
<block subset="none" type="usage">The <see cref="M:System.IO.FileStream.Finalize" />
method invokes <see langword="Close " />so that the file stream is closed
before the garbage collector finalizes the object. However, objects writing to
the <see cref="T:System.IO.FileStream" />, such as a <see cref="T:System.IO.StreamWriter" />, might not have flushed
the data from their internal buffers to the <see cref="T:System.IO.FileStream" /> when the call to <see langword="Finalize" /> closes
the stream. To prevent data loss, always call <see langword="Close" /> on the highest-level object.</block>
</para>
<para>
<block subset="none" type="note">
This method overrides <see cref="M:System.IO.Stream.Close" qualify="true" />.
</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="ILASM" Value=".method family hidebysig virtual void Dispose(bool disposing)" />
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method is called by the public <see cref="M:System.ComponentModel.Component.Dispose" /> method and the <see cref="M:System.Object.Finalize" /> method. <see cref="M:System.ComponentModel.Component.Dispose" /> invokes the protected <see cref="M:System.IO.FileStream.Dispose(System.Boolean)" /> method with the <paramref name="disposing" /> parameter set to true. <see cref="M:System.Object.Finalize" /> invokes <see cref="M:System.IO.FileStream.Dispose(System.Boolean)" /> with <paramref name="disposing" /> set to false.</para>
<para>When the <paramref name="disposing" /> parameter is true, this method releases all resources held by any managed objects that this <see cref="T:System.IO.FileStream" /> references. This method invokes the <see cref="M:System.ComponentModel.Component.Dispose" /> method of each referenced object.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Releases the unmanaged resources used by the <see cref="T:System.IO.FileStream" /> and optionally releases the managed resources.</para>
</summary>
<param name="disposing">
<attribution license="cc4" from="Microsoft" modified="false" />true to release both managed and unmanaged resources; false to release only unmanaged resources. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="EndRead">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual int32 EndRead(class System.IAsyncResult asyncResult)" />
<MemberSignature Language="C#" Value="public override int EndRead (IAsyncResult asyncResult);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 EndRead(class System.IAsyncResult asyncResult) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">
<paramref name="asyncResult" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="asyncResult" /> was not returned by a call to <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" /> was called multiple times with <paramref name="asyncResult" /> .</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>In the .NET Framework 4 and earlier versions, you have to use methods such as <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> and <see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" /> to implement asynchronous file operations. These methods are still available in the net_v45 to support legacy code; however, the new async methods, such as <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.Stream.CopyToAsync(System.IO.Stream)" />, and <see cref="M:System.IO.FileStream.FlushAsync(System.Threading.CancellationToken)" />, help you implement asynchronous file operations more easily.</para>
<para>
<see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" /> must be called exactly for every call to <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />. Failing to end a read process before beginning another read can cause undesirable behavior such as deadlock.</para>
<para>This method overrides <see cref="M:System.IO.Stream.EndRead(System.IAsyncResult)" />.</para>
<para>
<see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" /> can be called on every <see cref="T:System.IAsyncResult" /> from <see cref="M:System.IO.FileStream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />. Calling <see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" /> tells you how many bytes were read from the stream. <see cref="M:System.IO.FileStream.EndRead(System.IAsyncResult)" /> will block until the I/O operation has completed.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Waits for the pending asynchronous read operation to complete. (Consider using <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" /> instead; see the Remarks section.)</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The number of bytes read from the stream, between 0 and the number of bytes you requested. Streams only return 0 at the end of the stream, otherwise, they should block until at least 1 byte is available.</para>
</returns>
<param name="asyncResult">
<attribution license="cc4" from="Microsoft" modified="false" />The reference to the pending asynchronous request to wait for. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="EndWrite">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void EndWrite(class System.IAsyncResult asyncResult)" />
<MemberSignature Language="C#" Value="public override void EndWrite (IAsyncResult asyncResult);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void EndWrite(class System.IAsyncResult asyncResult) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">
<paramref name="asyncResult" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="asyncResult" /> was not returned by a call to <see cref="M:System.IO.FileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />.</exception>
<exception cref="T:System.InvalidOperationException">
<see cref="M:System.IO.FileStream.EndWrite(System.IAsyncResult)" /> was called multiple times with <paramref name="asyncResult" /> .</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>In the .NET Framework 4 and earlier versions, you have to use methods such as <see cref="M:System.IO.FileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" /> and <see cref="M:System.IO.FileStream.EndWrite(System.IAsyncResult)" /> to implement asynchronous file operations. These methods are still available in the net_v45 to support legacy code; however, the new async methods, such as <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.Stream.CopyToAsync(System.IO.Stream)" />, and <see cref="M:System.IO.FileStream.FlushAsync(System.Threading.CancellationToken)" />, help you implement asynchronous file operations more easily.</para>
<para>This method overrides <see cref="M:System.IO.Stream.EndWrite(System.IAsyncResult)" />.</para>
<para>
<see cref="M:System.IO.FileStream.EndWrite(System.IAsyncResult)" /> must be called exactly once on every <see cref="T:System.IAsyncResult" /> from <see cref="M:System.IO.FileStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />. <see cref="M:System.IO.FileStream.EndWrite(System.IAsyncResult)" /> will block until the I/O operation has completed.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Ends an asynchronous write operation and blocks until the I/O operation is complete. (Consider using <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" /> instead; see the Remarks section.)</para>
</summary>
<param name="asyncResult">
<attribution license="cc4" from="Microsoft" modified="false" />The pending asynchronous I/O request. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Finalize">
<MemberSignature Language="ILASM" Value=".method family hidebysig virtual void Finalize()" />
<MemberSignature Language="C#" Value="~FileStream ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Finalize() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The garbage collector calls Finalize when the current object is ready to be finalized. Finalize closes the FileStream.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Ensures that resources are freed and other cleanup operations are performed when the garbage collector reclaims the FileStream.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Flush">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void Flush()" />
<MemberSignature Language="C#" Value="public override void Flush ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Flush() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<exception cref="T:System.ObjectDisposedException">The current instance has already been closed.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method overrides <see cref="M:System.IO.Stream.Flush" />. </para>
<para>When you call the <see cref="M:System.IO.FileStream.Flush" /> method, the operating system I/O buffer is also flushed.</para>
<para>A stream’s encoder is not flushed unless you explicitly call <see cref="M:System.IO.FileStream.Flush" /> or dispose of the object. Setting <see cref="P:System.IO.StreamWriter.AutoFlush" /> to true means that data will be flushed from the buffer to the stream, but the encoder state will not be flushed. This allows the encoder to keep its state (partial characters) so that it can encode the next block of characters correctly. This scenario affects UTF8 and UTF7 where certain characters can only be encoded after the encoder receives the adjacent character or characters.</para>
<para>Because a buffer can be used for either reading or writing, <see cref="M:System.IO.FileStream.Flush" /> performs the following two functions: </para>
<list type="bullet">
<item>
<para>Any data previously written to the buffer is copied to the file and the buffer is cleared except for its encoder state.</para>
</item>
<item>
<para>If <see cref="P:System.IO.BufferedStream.CanSeek" /> is true and data was previously copied from the file to the buffer for reading, the current position within the file is decremented by the number of unread bytes in the buffer. The buffer is then cleared.</para>
</item>
</list>
<para>Use the <see cref="M:System.IO.FileStream.Flush(System.Boolean)" /> method overload when you want to ensure that all buffered data in intermediate file buffers is written to disk.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Clears buffers for this stream and causes any buffered data to be written to the file.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Flush">
<MemberSignature Language="C#" Value="public virtual void Flush (bool flushToDisk);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Flush(bool flushToDisk) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="flushToDisk" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Use this overload when you want to ensure that all buffered data in intermediate file buffers is written to disk. </para>
<para>When you call the <see cref="M:System.IO.FileStream.Flush(System.Boolean)" /> method, the operating system I/O buffer is also flushed.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Clears buffers for this stream and causes any buffered data to be written to the file, and also clears all intermediate file buffers.</para>
</summary>
<param name="flushToDisk">
<attribution license="cc4" from="Microsoft" modified="false" />true to flush all intermediate file buffers; otherwise, false. </param>
</Docs>
</Member>
<Member MemberName="FlushAsync">
<MemberSignature Language="C#" Value="public override System.Threading.Tasks.Task FlushAsync (System.Threading.CancellationToken cancellationToken);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Threading.Tasks.Task FlushAsync(valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>When you call the <see cref="M:System.IO.FileStream.FlushAsync(System.Threading.CancellationToken)" /> method, the operating system I/O buffer is also flushed.</para>
<para>If the operation is canceled before it completes, the returned task contains the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="P:System.Threading.Tasks.Task.Status" /> property. If the handle to the file is disposed, the returned task contains the <see cref="T:System.ObjectDisposedException" /> exception in the <see cref="P:System.Threading.Tasks.Task.Exception" /> property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests. </para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A task that represents the asynchronous flush operation. </para>
</returns>
<param name="cancellationToken">
<attribution license="cc4" from="Microsoft" modified="false" />The token to monitor for cancellation requests.</param>
</Docs>
</Member>
<Member MemberName="GetAccessControl">
<MemberSignature Language="C#" Value="public System.Security.AccessControl.FileSecurity GetAccessControl ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Security.AccessControl.FileSecurity GetAccessControl() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Security.AccessControl.FileSecurity</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>While the <see cref="T:System.IO.FileStream" /> class and <see cref="M:System.IO.FileStream.GetAccessControl" /> can be used to retrieve the access control list (ACL) entries of an existing file, consider using <see cref="M:System.IO.File.GetAccessControl(System.String)" /> method, as it is easier to use.</para>
<para>Use the <see cref="M:System.IO.FileStream.GetAccessControl" /> method to retrieve the ACL entries for a file.</para>
<para>An ACL describes individuals and/or groups who have, or do not have, rights to specific actions on the given file. For more information, see <format type="text/html"><a href="06fbf66d-6f02-4378-b863-b2f12e349045">ACL Technology Overview</a></format> and <format type="text/html"><a href="53758b39-bd9b-4640-bb04-cad5ed8d0abf">How to: Add or Remove an Access Control List Entry</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a <see cref="T:System.Security.AccessControl.FileSecurity" /> object that encapsulates the access control list (ACL) entries for the file described by the current <see cref="T:System.IO.FileStream" /> object.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>An object that encapsulates the access control settings for the file described by the current <see cref="T:System.IO.FileStream" /> object.</para>
</returns>
</Docs>
</Member>
<Member MemberName="Handle">
<MemberSignature Language="C#" Value="public virtual IntPtr Handle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance native int Handle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Obsolete("Use SafeFileHandle instead")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IntPtr</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This property is an operating system handle for use with operating-system-provided system calls (such as ReadFile on Windows). It will not work with C library functions that expect a file descriptor, such as fread.</para>
<para>The operating system handle might have been opened synchronously or asynchronously, depending on which FileStream constructor was called. Use the <see cref="P:System.IO.FileStream.IsAsync" /> property to discover whether this handle was opened asynchronously. In Win32, this means the handle was opened for overlapped IO, and it requires different parameters to ReadFile and WriteFile.</para>
<block subset="none" type="note">
<para>Data corruption might occur if a FileStream is created, its handle is passed, some operation moves the handle's file pointer, and then the FileStream is used again. Multiple threads cannot safely write to the same file simultaneously, and FileStream buffering code assumes that it exclusively controls the handle. FileStream might throw an <see cref="T:System.IO.IOException" /> if FileStream detects that some other process has moved the file pointer. To avoid this, do not write any data into a portion of the file that FileStream might have buffered, and restore the file pointer to the location it had when methods were last called on FileStream.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the operating system file handle for the file that the current FileStream object encapsulates.</para>
</summary>
</Docs>
</Member>
<Member MemberName="IsAsync">
<MemberSignature Language="ILASM" Value=".property bool IsAsync { public hidebysig virtual specialname bool get_IsAsync() }" />
<MemberSignature Language="C#" Value="public virtual bool IsAsync { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsAsync" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>
<para>
<see langword="true" /> if the
current
<see cref="T:System.IO.FileStream" /> was opened
asynchronously; otherwise, <see langword="false" />.</para>
</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The IsAsync property detects whether the FileStream handle was opened asynchronously, enabling your code to use the <see cref="P:System.IO.FileStream.Handle" /> property correctly. In Win32, IsAsync being true means the handle was opened for overlapped I/O, and thus requires different parameters to ReadFile and WriteFile.</para>
<para>You specify this value when you create an instance of the <see cref="T:System.IO.FileStream" /> class using a constructor that has an <paramref name="isAsync" />, <paramref name="useAsync" />, or <paramref name="options" /> parameter. When the property is true, the stream utilizes overlapped I/O to perform file operations asynchronously. However, the <see cref="P:System.IO.FileStream.IsAsync" /> property does not have to be true to call the <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" />, or <see cref="M:System.IO.Stream.CopyToAsync(System.IO.Stream)" /> method. When the <see cref="P:System.IO.FileStream.IsAsync" /> property is false and you call the asynchronous read and write operations, the UI thread is still not blocked, but the actual I/O operation is performed synchronously.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a value indicating whether the FileStream was opened asynchronously or synchronously.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Length">
<MemberSignature Language="ILASM" Value=".property int64 Length { public hidebysig virtual specialname int64 get_Length() }" />
<MemberSignature Language="C#" Value="public override long Length { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int64 Length" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int64</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>
<para>A <see cref="T:System.Int64" /> value containing the length of the stream in bytes.</para>
</value>
<exception cref="T:System.NotSupportedException">
<see cref="P:System.IO.FileStream.CanSeek" /> for this stream is <see langword="false" />.</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred, such as the file being closed.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the length in bytes of the stream.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Lock">
<MemberSignature Language="C#" Value="public virtual void Lock (long position, long length);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Lock(int64 position, int64 length) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="position" Type="System.Int64" />
<Parameter Name="length" Type="System.Int64" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Locking a range of a file stream gives the threads of the locking process exclusive access to that range of the file stream.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Prevents other processes from reading from or writing to the <see cref="T:System.IO.FileStream" />.</para>
</summary>
<param name="position">
<attribution license="cc4" from="Microsoft" modified="false" />The beginning of the range to lock. The value of this parameter must be equal to or greater than zero (0). </param>
<param name="length">
<attribution license="cc4" from="Microsoft" modified="false" />The range to be locked. </param>
</Docs>
</Member>
<Member MemberName="Name">
<MemberSignature Language="C#" Value="public string Name { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Name" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets the name of the FileStream that was passed to the constructor.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Position">
<MemberSignature Language="ILASM" Value=".property int64 Position { public hidebysig virtual specialname int64 get_Position() public hidebysig virtual specialname void set_Position(int64 value) }" />
<MemberSignature Language="C#" Value="public override long Position { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int64 Position" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int64</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<value>
<para> A <see cref="T:System.Int64" /> containing the current position of this stream.</para>
</value>
<exception cref="T:System.NotSupportedException">The current stream does not support seeking.</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<exception cref="T:System.IO.EndOfStreamException">Attempted seeking past the end of a stream that does not support this.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The value specified for a set operation is negative.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Seeking to any location beyond the length of the stream is supported. When you seek beyond the length of the file, the file size grows. In Microsoft Windows NT and newer, any data added to the end of the file is set to zero. In Microsoft Windows 98 or earlier, any data added to the end of the file is not set to zero, which means that previously deleted data is visible to the stream. Setting the position of the stream to a large value beyond the end of the stream in Windows 98 or earlier may result in an exception being raised.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets or sets the current position of this stream.</para>
</summary>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Read">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual int32 Read(class System.Byte[] array, int32 offset, int32 count)" />
<MemberSignature Language="C#" Value="public override int Read (byte[] array, int offset, int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 Read(unsigned int8[] array, int32 offset, int32 count) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="System.Byte[]" />
<Parameter Name="offset" Type="System.Int32" />
<Parameter Name="count" Type="System.Int32" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">
<paramref name="array" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="offset" /> or <paramref name="count " /> is negative.</exception>
<exception cref="T:System.NotSupportedException">The current stream does not support reading.</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="offset " /> + <paramref name="count" /> is greater than the length of <paramref name="array" />.</exception>
<exception cref="T:System.ObjectDisposedException">The current stream is closed.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method overrides <see cref="M:System.IO.Stream.Read(System.Byte[],System.Int32,System.Int32)" />.</para>
<para>The <paramref name="offset" /> parameter gives the offset of the byte in <paramref name="array" /> (the buffer index) at which to begin reading, and the <paramref name="count" /> parameter gives the maximum number of bytes to be read from this stream. The returned value is the actual number of bytes read, or zero if the end of the stream is reached. If the read operation is successful, the current position of the stream is advanced by the number of bytes read. If an exception occurs, the current position of the stream is unchanged.</para>
<para>The <see cref="M:System.IO.FileStream.Read(System.Byte[],System.Int32,System.Int32)" /> method returns zero only after reaching the end of the stream. Otherwise, <see cref="M:System.IO.FileStream.Read(System.Byte[],System.Int32,System.Int32)" /> always reads at least one byte from the stream before returning. If no data is available from the stream upon a call to <see cref="M:System.IO.FileStream.Read(System.Byte[],System.Int32,System.Int32)" />, the method will block until at least one byte of data can be returned. An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached.</para>
<para>Use <see cref="T:System.IO.BinaryReader" /> for reading primitive data types.</para>
<para>Do not interrupt a thread that is performing a read operation. Although the application may appear to run successfully after the thread is unblocked, the interruption can decrease your application's performance and reliability.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Reads a block of bytes from the stream and writes the data in a given buffer.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The total number of bytes read into the buffer. This might be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached.</para>
</returns>
<param name="array">
<attribution license="cc4" from="Microsoft" modified="false" />When this method returns, contains the specified byte array with the values between <paramref name="offset" /> and (<paramref name="offset" /> + <paramref name="count" /> - 1<paramref name=")" /> replaced by the bytes read from the current source. </param>
<param name="offset">
<attribution license="cc4" from="Microsoft" modified="false" />The byte offset in <paramref name="array" /> at which the read bytes will be placed. </param>
<param name="count">
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of bytes to read. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="ReadAsync">
<MemberSignature Language="C#" Value="public override System.Threading.Tasks.Task<int> ReadAsync (byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Threading.Tasks.Task`1<int32> ReadAsync(unsigned int8[] buffer, int32 offset, int32 count, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<System.Int32></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Byte[]" />
<Parameter Name="offset" Type="System.Int32" />
<Parameter Name="count" Type="System.Int32" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.IO.FileStream.ReadAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" /> method enables you to perform resource-intensive file operations without blocking the main thread. This performance consideration is particularly important in a win8_appname_long app or desktop_appname app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the async and await keywords in Visual Basic and C#.</para>
<para>Use the <see cref="P:System.IO.FileStream.CanRead" /> property to determine whether the current instance supports reading.</para>
<para>If the operation is canceled before it completes, the returned task contains the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="P:System.Threading.Tasks.Task.Status" /> property. If the handle to the file is disposed, the returned task contains the <see cref="T:System.ObjectDisposedException" /> exception in the <see cref="P:System.Threading.Tasks.Task.Exception" /> property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A task that represents the asynchronous read operation. The value of the <paramref name="TResult" /> parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. </para>
</returns>
<param name="buffer">
<attribution license="cc4" from="Microsoft" modified="false" />The buffer to write the data into.</param>
<param name="offset">
<attribution license="cc4" from="Microsoft" modified="false" />The byte offset in <paramref name="buffer" /> at which to begin writing data from the stream.</param>
<param name="count">
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of bytes to read.</param>
<param name="cancellationToken">
<attribution license="cc4" from="Microsoft" modified="false" />The token to monitor for cancellation requests.</param>
</Docs>
</Member>
<Member MemberName="ReadByte">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual int32 ReadByte()" />
<MemberSignature Language="C#" Value="public override int ReadByte ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 ReadByte() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<exception cref="T:System.ObjectDisposedException">The current stream is closed.</exception>
<exception cref="T:System.NotSupportedException">The current stream does not support reading.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method overrides <see cref="M:System.IO.Stream.ReadByte" />.</para>
<block subset="none" type="note">
<para>Use the <see cref="P:System.IO.FileStream.CanRead" /> property to determine whether the current instance supports reading. For additional information, see <see cref="P:System.IO.Stream.CanRead" />.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Reads a byte from the file and advances the read position one byte.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The byte, cast to an <see cref="T:System.Int32" />, or -1 if the end of the stream has been reached.</para>
</returns>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="SafeFileHandle">
<MemberSignature Language="C#" Value="public virtual Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Win32.SafeHandles.SafeFileHandle</ReturnType>
</ReturnValue>
<Docs>
<value>To be added.</value>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="P:System.IO.FileStream.SafeFileHandle" /> property automatically flushes the stream and sets the current stream position to 0. This allows the file to be moved or the stream position to be reset by another stream using the <see cref="P:System.IO.FileStream.SafeFileHandle" /> returned by this property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Gets a <see cref="T:Microsoft.Win32.SafeHandles.SafeFileHandle" /> object that represents the operating system file handle for the file that the current <see cref="T:System.IO.FileStream" /> object encapsulates.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Seek">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual int64 Seek(int64 offset, valuetype System.IO.SeekOrigin origin)" />
<MemberSignature Language="C#" Value="public override long Seek (long offset, System.IO.SeekOrigin origin);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int64 Seek(int64 offset, valuetype System.IO.SeekOrigin origin) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int64</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="offset" Type="System.Int64" />
<Parameter Name="origin" Type="System.IO.SeekOrigin" />
</Parameters>
<Docs>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<exception cref="T:System.NotSupportedException">The stream does not support seeking.</exception>
<exception cref="T:System.ArgumentException">Attempted seeking before the beginning of the stream or to more than one byte past the end of the stream.</exception>
<exception cref="T:System.ObjectDisposedException">The current stream is closed.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method overrides <see cref="M:System.IO.Stream.Seek(System.Int64,System.IO.SeekOrigin)" />.</para>
<block subset="none" type="note">
<para>Use the <see cref="P:System.IO.FileStream.CanSeek" /> property to determine whether the current instance supports seeking. For additional information, see <see cref="P:System.IO.Stream.CanSeek" />.</para>
</block>
<para>You can seek to any location beyond the length of the stream. When you seek beyond the length of the file, the file size grows. In Windows NT and later versions, data added to the end of the file is set to zero. In Windows 98 or earlier versions, data added to the end of the file is not set to zero, which means that previously deleted data is visible to the stream.</para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Sets the current position of this stream to the given value.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The new position in the stream.</para>
</returns>
<param name="offset">
<attribution license="cc4" from="Microsoft" modified="false" />The point relative to <paramref name="origin" /> from which to begin seeking. </param>
<param name="origin">
<attribution license="cc4" from="Microsoft" modified="false" />Specifies the beginning, the end, or the current position as a reference point for <paramref name="offset" />, using a value of type <see cref="T:System.IO.SeekOrigin" />. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="SetAccessControl">
<MemberSignature Language="C#" Value="public void SetAccessControl (System.Security.AccessControl.FileSecurity fileSecurity);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetAccessControl(class System.Security.AccessControl.FileSecurity fileSecurity) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="fileSecurity" Type="System.Security.AccessControl.FileSecurity" />
</Parameters>
<Docs>
<since version=".NET 2.0" />
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>While the <see cref="T:System.IO.FileStream" /> class and <see cref="M:System.IO.FileStream.SetAccessControl(System.Security.AccessControl.FileSecurity)" /> can be used on an existing file, consider using the <see cref="M:System.IO.File.SetAccessControl(System.String,System.Security.AccessControl.FileSecurity)" /> method as it is easier to use.</para>
<para>The <see cref="M:System.IO.FileStream.SetAccessControl(System.Security.AccessControl.FileSecurity)" /> method applies access control list (ACL) entries to a file that represents the noninherited ACL list. </para>
<block subset="none" type="note">
<para>The ACL specified for the <paramref name="fileSecurity" /> parameter replaces the existing ACL for the file. To add permissions for a new user, use the <see cref="M:System.IO.FileStream.GetAccessControl" /> method to obtain the existing ACL, modify it, and then use <see cref="M:System.IO.FileStream.SetAccessControl(System.Security.AccessControl.FileSecurity)" /> to apply it back to the file.</para>
</block>
<para>An ACL describes individuals and/or groups who have, or do not have, rights to specific actions on the given file. For more information, see <format type="text/html"><a href="06fbf66d-6f02-4378-b863-b2f12e349045">ACL Technology Overview</a></format> and <format type="text/html"><a href="53758b39-bd9b-4640-bb04-cad5ed8d0abf">How to: Add or Remove an Access Control List Entry</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Applies access control list (ACL) entries described by a <see cref="T:System.Security.AccessControl.FileSecurity" /> object to the file described by the current <see cref="T:System.IO.FileStream" /> object.</para>
</summary>
<param name="fileSecurity">
<attribution license="cc4" from="Microsoft" modified="false" />An object that describes an ACL entry to apply to the current file.</param>
</Docs>
</Member>
<Member MemberName="SetLength">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void SetLength(int64 value)" />
<MemberSignature Language="C#" Value="public override void SetLength (long value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void SetLength(int64 value) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Int64" />
</Parameters>
<Docs>
<exception cref="T:System.IO.IOException"> An I/O error occurred.</exception>
<exception cref="T:System.NotSupportedException">The current stream does not support writing and seeking.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="value" /> is less than zero.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method overrides <see cref="M:System.IO.Stream.SetLength(System.Int64)" />.</para>
<para>If the given value is less than the current length of the stream, the stream is truncated. If the given value is larger than the current length of the stream, the stream is expanded. If the stream is expanded, the contents of the stream between the old and the new length are undefined.</para>
<para>A stream must support both writing and seeking for SetLength to work.</para>
<block subset="none" type="note">
<para>Use the <see cref="P:System.IO.FileStream.CanWrite" /> property to determine whether the current instance supports writing, and the <see cref="P:System.IO.FileStream.CanSeek" /> property to determine whether seeking is supported. For additional information, see <see cref="P:System.IO.Stream.CanWrite" /> and <see cref="P:System.IO.Stream.CanSeek" />.</para>
</block>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Sets the length of this stream to the given value.</para>
</summary>
<param name="value">
<attribution license="cc4" from="Microsoft" modified="false" />The new length of the stream. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Unlock">
<MemberSignature Language="C#" Value="public virtual void Unlock (long position, long length);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Unlock(int64 position, int64 length) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="position" Type="System.Int64" />
<Parameter Name="length" Type="System.Int64" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Allows access by other processes to all or part of a file that was previously locked.</para>
</summary>
<param name="position">
<attribution license="cc4" from="Microsoft" modified="false" />The beginning of the range to unlock. </param>
<param name="length">
<attribution license="cc4" from="Microsoft" modified="false" />The range to be unlocked. </param>
</Docs>
</Member>
<Member MemberName="Write">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void Write(class System.Byte[] array, int32 offset, int32 count)" />
<MemberSignature Language="C#" Value="public override void Write (byte[] array, int offset, int count);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Write(unsigned int8[] array, int32 offset, int32 count) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="array" Type="System.Byte[]" />
<Parameter Name="offset" Type="System.Int32" />
<Parameter Name="count" Type="System.Int32" />
</Parameters>
<Docs>
<exception cref="T:System.ArgumentNullException">
<paramref name="array" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="offset " />+ <paramref name="count" /> is greater than the length of <paramref name="array" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="offset" /> or <paramref name="count" /> is negative.</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred.</exception>
<exception cref="T:System.NotSupportedException">The current stream does not support writing.</exception>
<exception cref="T:System.ObjectDisposedException">An I/O error occurred.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method overrides <see cref="M:System.IO.Stream.Write(System.Byte[],System.Int32,System.Int32)" />.</para>
<para>The <paramref name="offset" /> parameter gives the offset of the byte in <paramref name="array" /> (the buffer index) at which to begin copying, and the <paramref name="count" /> parameter gives the number of bytes that will be written to the stream. If the write operation is successful, the current position of the stream is advanced by the number of bytes written. If an exception occurs, the current position of the stream is unchanged.</para>
<block subset="none" type="note">
<para>Use the <see cref="P:System.IO.FileStream.CanWrite" /> property to determine whether the current instance supports writing. For additional information, see <see cref="P:System.IO.Stream.CanWrite" />.</para>
</block>
<para>Do not interrupt a thread that is performing a write operation. Although the application may appear to run successfully after the thread is unblocked, the interruption can decrease your application's performance and reliability. </para>
<para>For a list of common file and directory operations, see <format type="text/html"><a href="bf00c380-706a-4e38-b829-454a480629fc">Common I/O Tasks</a></format>.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Writes a block of bytes to the file stream.</para>
</summary>
<param name="array">
<attribution license="cc4" from="Microsoft" modified="false" />The buffer containing data to write to the stream.</param>
<param name="offset">
<attribution license="cc4" from="Microsoft" modified="false" />The zero-based byte offset in <paramref name="array" /> from which to begin copying bytes to the stream. </param>
<param name="count">
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of bytes to write. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="WriteAsync">
<MemberSignature Language="C#" Value="public override System.Threading.Tasks.Task WriteAsync (byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Threading.Tasks.Task WriteAsync(unsigned int8[] buffer, int32 offset, int32 count, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.Byte[]" />
<Parameter Name="offset" Type="System.Int32" />
<Parameter Name="count" Type="System.Int32" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="M:System.IO.FileStream.WriteAsync(System.Byte[],System.Int32,System.Int32,System.Threading.CancellationToken)" /> method enables you to perform resource-intensive file operations without blocking the main thread. This performance consideration is particularly important in a win8_appname_long app or desktop_appname app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. The async methods are used in conjunction with the async and await keywords in Visual Basic and C#.</para>
<para>Use the <see cref="P:System.IO.FileStream.CanWrite" /> property to determine whether the current instance supports reading.</para>
<para>If the operation is canceled before it completes, the returned task contains the <see cref="F:System.Threading.Tasks.TaskStatus.Canceled" /> value for the <see cref="P:System.Threading.Tasks.Task.Status" /> property. If the handle to the file is disposed, the returned task contains the <see cref="T:System.ObjectDisposedException" /> exception in the <see cref="P:System.Threading.Tasks.Task.Exception" /> property.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests. </para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>A task that represents the asynchronous write operation.</para>
</returns>
<param name="buffer">
<attribution license="cc4" from="Microsoft" modified="false" />The buffer to write data from. </param>
<param name="offset">
<attribution license="cc4" from="Microsoft" modified="false" />The zero-based byte offset in <paramref name="buffer" /> from which to begin copying bytes to the stream.</param>
<param name="count">
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of bytes to write.</param>
<param name="cancellationToken">
<attribution license="cc4" from="Microsoft" modified="false" />The token to monitor for cancellation requests.</param>
</Docs>
</Member>
<Member MemberName="WriteByte">
<MemberSignature Language="ILASM" Value=".method public hidebysig virtual void WriteByte(unsigned int8 value)" />
<MemberSignature Language="C#" Value="public override void WriteByte (byte value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void WriteByte(unsigned int8 value) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Byte" />
</Parameters>
<Docs>
<exception cref="T:System.IO.IOException">The current stream is closed.</exception>
<exception cref="T:System.NotSupportedException">The current stream does not support writing.</exception>
<exception cref="T:System.ObjectDisposedException">The current stream is closed.</exception>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method overrides <see cref="M:System.IO.Stream.WriteByte(System.Byte)" />.</para>
<para>Use WriteByte to write a byte to a FileStream efficiently. If the stream is closed or not writable, an exception will be thrown.</para>
<block subset="none" type="note">
<para>Use the <see cref="P:System.IO.FileStream.CanWrite" /> property to determine whether the current instance supports writing. For additional information, see <see cref="P:System.IO.Stream.CanWrite" />.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Writes a byte to the current position in the file stream.</para>
</summary>
<param name="value">
<attribution license="cc4" from="Microsoft" modified="false" />A byte to write to the stream. </param>
</Docs>
<Excluded>0</Excluded>
</Member>
</Members>
<TypeExcluded>0</TypeExcluded>
</Type>
|