public class SeekableResourceStream
extends java.io.InputStream
implements org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.PositionedReadable
Seekable stream from a Resource for testing| Constructor and Description |
|---|
SeekableResourceStream(org.openstreetmap.atlas.streaming.resource.Resource resource) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getPos() |
int |
read() |
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 |
seek(long pos) |
boolean |
seekToNewSource(long targetPos) |
public SeekableResourceStream(org.openstreetmap.atlas.streaming.resource.Resource resource)
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreampublic long getPos()
throws java.io.IOException
getPos in interface org.apache.hadoop.fs.Seekablejava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(long position,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in interface org.apache.hadoop.fs.PositionedReadablejava.io.IOExceptionpublic void readFully(long position,
byte[] buffer)
throws java.io.IOException
readFully in interface org.apache.hadoop.fs.PositionedReadablejava.io.IOExceptionpublic void readFully(long position,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
readFully in interface org.apache.hadoop.fs.PositionedReadablejava.io.IOExceptionpublic void seek(long pos)
throws java.io.IOException
seek in interface org.apache.hadoop.fs.Seekablejava.io.IOExceptionpublic boolean seekToNewSource(long targetPos)
throws java.io.IOException
seekToNewSource in interface org.apache.hadoop.fs.Seekablejava.io.IOException