Class SeekableResourceStream
- java.lang.Object
-
- java.io.InputStream
-
- org.openstreetmap.atlas.generator.tools.streaming.SeekableResourceStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.hadoop.fs.PositionedReadable,org.apache.hadoop.fs.Seekable
public class SeekableResourceStream extends java.io.InputStream implements org.apache.hadoop.fs.Seekable, org.apache.hadoop.fs.PositionedReadableFake aSeekablestream from aResourcefor testing
-
-
Constructor Summary
Constructors Constructor Description SeekableResourceStream(org.openstreetmap.atlas.streaming.resource.Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetPos()intread()intread(long position, byte[] buffer, int offset, int length)voidreadFully(long position, byte[] buffer)voidreadFully(long position, byte[] buffer, int offset, int length)voidseek(long pos)booleanseekToNewSource(long targetPos)
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream
-
getPos
public long getPos() throws java.io.IOException- Specified by:
getPosin interfaceorg.apache.hadoop.fs.Seekable- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(long position, byte[] buffer, int offset, int length) throws java.io.IOException- Specified by:
readin interfaceorg.apache.hadoop.fs.PositionedReadable- Throws:
java.io.IOException
-
readFully
public void readFully(long position, byte[] buffer) throws java.io.IOException- Specified by:
readFullyin interfaceorg.apache.hadoop.fs.PositionedReadable- Throws:
java.io.IOException
-
readFully
public void readFully(long position, byte[] buffer, int offset, int length) throws java.io.IOException- Specified by:
readFullyin interfaceorg.apache.hadoop.fs.PositionedReadable- Throws:
java.io.IOException
-
seek
public void seek(long pos) throws java.io.IOException- Specified by:
seekin interfaceorg.apache.hadoop.fs.Seekable- Throws:
java.io.IOException
-
seekToNewSource
public boolean seekToNewSource(long targetPos) throws java.io.IOException- Specified by:
seekToNewSourcein interfaceorg.apache.hadoop.fs.Seekable- Throws:
java.io.IOException
-
-