public class LocalDataInputStream extends FSDataInputStream
LocalDataInputStream
class is a wrapper class for a data
input stream to the local file system.Constructor and Description |
---|
LocalDataInputStream(java.io.File file)
Constructs a new
LocalDataInputStream object from a given File object. |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
java.nio.channels.FileChannel |
getChannel() |
long |
getPos()
Gets the current position in the input stream.
|
java.io.Reader |
getReader() |
int |
read() |
int |
read(byte[] buffer,
int offset,
int length) |
void |
seek(long desired)
Seek to the given offset from the start of the file.
|
long |
skip(long n) |
public LocalDataInputStream(java.io.File file) throws java.io.IOException
LocalDataInputStream
object from a given File
object.file
- The File the data stream is read fromjava.io.IOException
- Thrown if the data input stream cannot be created.public void seek(long desired) throws java.io.IOException
FSDataInputStream
seek
in class FSDataInputStream
desired
- the desired offsetjava.io.IOException
- Thrown if an error occurred while seeking inside the input stream.public long getPos() throws java.io.IOException
FSDataInputStream
getPos
in class FSDataInputStream
java.io.IOException
- Thrown if an I/O error occurred in the underlying stream
implementation while accessing the stream's position.public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public java.io.Reader getReader() throws java.io.FileNotFoundException
getReader
in class FSDataInputStream
java.io.FileNotFoundException
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public java.nio.channels.FileChannel getChannel()