@Internal 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(File file)
Constructs a new
LocalDataInputStream object from a given File object. |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
long |
getPos()
Get the current position in the input stream.
|
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) |
mark, markSupported, read, resetpublic LocalDataInputStream(File file) throws IOException
LocalDataInputStream object from a given File object.file - the File object the data stream is written toIOException - thrown if the data input stream cannot be createdpublic void seek(long desired)
throws IOException
FSDataInputStreamseek in class FSDataInputStreamdesired - the desired offsetIOException - thrown if an error occurred while seeking inside the input streampublic long getPos()
throws IOException
FSDataInputStreamgetPos in class FSDataInputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws IOException
read in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.