FSDataInputStream IS an InputStream. So you can wrap it with another implementation of InputStream, i.e. ObjectInputStream to read your serialized data.
On Sat, May 15, 2010 at 7:40 AM, akhil1988 <[email protected]> wrote: > > I have a file that contains java serialized objects like "Vector". I have > stored this file over Hadoop Distributed File System(HDFS). Now I intend to > read this file (using method readObject) in one of the map task. I suppose > > FileInputStream in = new FileInputStream("hdfs/path/to/file"); > > wont' work as the file is stored over HDFS. So I thought of using > org.apache.hadoop.fs.FileSystem class. But Unfortunately it does not have > any method that returns FileInputStream. All it has is a method that > returns > FSDataInputStream but I want a inputstream that can read serialized java > objects like vector from a file rather than just primitive data types that > FSDataInputStream would do > -- > View this message in context: > http://old.nabble.com/FileInputStream-for-HDFS-tp28567783p28567783.html > Sent from the Hadoop core-user mailing list archive at Nabble.com. > >
