Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File and FileDescriptor

 
Siva kandasamy
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9302
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Siva kandasamy
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9302
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DataInputStream and DataOutputStream are transforming raw bytes into Java primitive types or vice-versa.
 
Siva kandasamy
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Joe. I think, it makes sense. I will try more.
thanks
siva
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic