File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes File and FileDescriptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "File and FileDescriptor" Watch "File and FileDescriptor" New topic
Author

File and FileDescriptor

Siva kandasamy
Ranch Hand

Joined: Dec 31, 2002
Posts: 139
Hi some basic questions.

1. - How File and FileDescriptors class are different in java
- What it represents.
- What we can not achive through File class,
we have to depend on "FileDescriptors"

2. What is Filter Streams ? Can you give me an example.

thanks in advance
siva
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8707
    
    6

The documentation answers all of your questions:
java.io.File
An abstract representation of file and directory pathnames.


java.io.FileDescriptor
The main practical use for a file descriptor is to create a FileInputStream or FileOutputStream to contain it.
Applications should not create their own file descriptors.


Filter streams are specalized streams which transform the data moving through them. There are examples in Java Tutorial


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Siva kandasamy
Ranch Hand

Joined: Dec 31, 2002
Posts: 139
Joe,
Thank You. Code appended here is example for Filter streams. Please help me to identify the transformation of data.
"which transform the data moving through them", what we mean here.
Thanks you
siva


Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8707
    
    6

DataInputStream and DataOutputStream are transforming raw bytes into Java primitive types or vice-versa.
Siva kandasamy
Ranch Hand

Joined: Dec 31, 2002
Posts: 139
Thank You Joe. I think, it makes sense. I will try more.
thanks
siva
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File and FileDescriptor
 
Similar Threads
RAF pool
File read write problem
max no of files in solaris
Accessing Oracle Bfile
Read Byte Code