private static class FileLink.FileLinkInputStream extends InputStream implements org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.PositionedReadable
| Modifier and Type | Field and Description |
|---|---|
private int |
bufferSize |
private org.apache.hadoop.fs.Path |
currentPath |
private FileLink |
fileLink |
private org.apache.hadoop.fs.FileSystem |
fs |
private org.apache.hadoop.fs.FSDataInputStream |
in |
private long |
pos |
| Constructor and Description |
|---|
FileLink.FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs,
FileLink fileLink) |
FileLink.FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs,
FileLink fileLink,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
long |
getPos() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
int |
read(long position,
byte[] buffer,
int offset,
int length) |
void |
readFully(long position,
byte[] buffer) |
void |
readFully(long position,
byte[] buffer,
int offset,
int length) |
void |
reset() |
void |
seek(long pos) |
boolean |
seekToNewSource(long targetPos) |
long |
skip(long n) |
private org.apache.hadoop.fs.FSDataInputStream |
tryOpen()
Try to open the file from one of the available locations.
|
private org.apache.hadoop.fs.FSDataInputStream in
private org.apache.hadoop.fs.Path currentPath
private long pos
private final FileLink fileLink
private final int bufferSize
private final org.apache.hadoop.fs.FileSystem fs
public FileLink.FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs,
FileLink fileLink)
throws IOException
IOExceptionpublic FileLink.FileLinkInputStream(org.apache.hadoop.fs.FileSystem fs,
FileLink fileLink,
int bufferSize)
throws IOException
IOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
read in interface org.apache.hadoop.fs.PositionedReadableIOExceptionpublic void readFully(long position,
byte[] buffer)
throws IOException
readFully in interface org.apache.hadoop.fs.PositionedReadableIOExceptionpublic void readFully(long position,
byte[] buffer,
int offset,
int length)
throws IOException
readFully in interface org.apache.hadoop.fs.PositionedReadableIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void seek(long pos)
throws IOException
seek in interface org.apache.hadoop.fs.SeekableIOExceptionpublic long getPos()
throws IOException
getPos in interface org.apache.hadoop.fs.SeekableIOExceptionpublic boolean seekToNewSource(long targetPos)
throws IOException
seekToNewSource in interface org.apache.hadoop.fs.SeekableIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic void mark(int readlimit)
mark in class InputStreampublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreamprivate org.apache.hadoop.fs.FSDataInputStream tryOpen()
throws IOException
IOException - on unexpected error, or file not found.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.