Cannot find symbol
Hi,
I'm getting this error when i use Out.writeUTF("Hello");
I have imported
import java.io.*;
import java.util.*;
This is the error message that im currently getting.
C:\Program Files\Java>javac Encoder.java
Encoder.java:52: cannot find symbol
symbol : method writeUTF(java.lang.String)
location: class java.io.OutputStream
Out.writeUTF("Hello");
Is there something i need to import.
Im not really sure.
Thanks.
[503 byte] By [
carrics3a] at [2007-11-27 1:40:03]

Hi,
I made a sample program and the writeUTF() works.
But i cant figure out why it wont work for other program
Here is the part of the program where i call the writeUTF() function
public void encode(InputStream In, OutputStream Out, Hashtable<String, Integer> dictionary)throws IOException
{
try{
int dictionarySize = 256;
int reader = 0;
String addVal="";
//byte[] convertedVal;
String firstVal= (char)In.read()+"";
while(In.available()>0)
{
reader=In.read();
if(dictionary.containsKey(firstVal + (char)reader)){
firstVal = firstVal + (char)reader;
System.out.println("Im Here");
}
else
{
System.out.println("Im here 2");
Out.writeUTF(firstVal);
addVal = firstVal + (char)reader;
dictionary.put(addVal, dictionarySize);
firstVal = (char)reader+"";
dictionarySize++;
}
}
Out.writeUTF(firstVal);
System.out.println("Dictionary Size is now "+dictionarySize);
}
catch(IOException e){
e.printStackTrace();
}
}
> I know for Writer the close method is documented that> it "Closes the stream, flushing it first."> But is that true for OutputStreams?For ones needing to be flushed (buffered ones only), yes. If not, we're all in big trouble.