Java Reference
In-Depth Information
L ISTING D.10 Continued
/**
* return whether the file can be written
*/
public boolean canWrite() throws java.io.IOException {
return wrappedFile.canWrite();
}
/**
* returns the inputStream
*/
public InputStream getInputStream() throws java.io.IOException {
return wrappedFile.toURL().openStream();
}
/**
* obtains the file length
*/
public long getLength() throws java.io.IOException {
return wrappedFile.length();
}
/**
* return the max length
*/
public long getMaxLength() throws java.io.IOException {
System.out.println(“Method getMaxLength() not supported.”);
return -1L;
}
/**
* return file name
*/
public String getName() throws java.io.IOException {
return wrappedFile.getName();
}
/**
* Return an outputStream for the given file.
* this method is aprtially supported
*/
public OutputStream getOutputStream(boolean boo) throws
java.io.IOException {
return new FileOutputStream(wrappedFile);
}
Search WWH ::




Custom Search