What are you asking? Are you suggesting that IntelliSense should provide help/information for types/members that, as far it is concerned, don't exist? Or, are you asking how to port use of Java's BufferedInputStream to .NET? In either case, nothing in the C# Language can address this.
using System;
using System.IO;
namespace IO
{
public class
{
void SystemIOStuff()
{
StreamReader sReader = new StreamReader("C:\\Users\\Shaun\\Desktop\\File.txt");
sReader.ReadLine();
sReader.Close();
}
}
}
NOTE: Don't forget to always close the reader when finished, and when finished with writing, through the StreamWriter class, always do sWriter.Flush(), and sWriter.Close();
And no, Intellisense will not, and does not store a database of unknown words, and suggestions for changing them, how would that even work\ be made to work? Intellisense however, does correct you when you use namespaces or classes incorrectly, and should be using another, or a method.
Right, there's nothing specific to the C# language to support I/O--that's the domain the Framework Class Library and the Base Classs Library.
hill0093 wrote:
I have the “csharp language specification v1.2” and it doesn’t say anything about file input. My final sentence in that post was “I need the reference for input from files”. I’m glad you caught the main point, Predator14567, even though you do not have as many posts as some. The second main point is that I need to know how to program for fast input of unspecified type of file. I need something for the rest of the stuff that is not covered in the “csharp language specification v1.2” but comparable for binary input of any file. However, I will be looking and starting with what you suggest. Thanks a whole bunch. I do programming in my off-work hours, so maybe tomorrow.
I've moved your post from the C# Language forum to the .NET Base Class Library Forum for better exposure
I don't know if this will help, but it may.
// This is the buffer we're going to put the file contents into
MemoryStream memoryStream = new MemoryStream();
// -1 indicates end of file and is why ReadByte() returns an int instead of a byte
using(FileStream fileStream = new FileStream(@"c:\INSTALL.LOG", FileMode.Open))
while ((Byte = fileStream.ReadByte()) != -1)
// Append that byte to into the buffer
memoryStream.WriteByte((byte)Byte);
// Byte array of file's contents
byte[] binaryFileContents = memoryStream.ToArray();
// Throw the garbage out
memoryStream.Dispose();
BTW, there's also the BufferedStream class.
I recommend Essential C# 2.0 by Mark Michaelis and Effective C# once you're familiar with the syntax.