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
FSDataInputStreamseek in class FSDataInputStreamdesired - the desired offsetjava.io.IOException - Thrown if an error occurred while seeking inside the input stream.public long getPos()
throws java.io.IOException
FSDataInputStreamgetPos in class FSDataInputStreamjava.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.InputStreamjava.io.IOExceptionpublic java.io.Reader getReader()
throws java.io.FileNotFoundException
getReader in class FSDataInputStreamjava.io.FileNotFoundExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic java.nio.channels.FileChannel getChannel()