Class HdfsRandomAccessContent
java.lang.Object
org.apache.commons.vfs2.provider.AbstractRandomAccessContent
org.apache.commons.vfs2.provider.hdfs.HdfsRandomAccessContent
- All Implemented Interfaces:
Closeable
,DataInput
,DataOutput
,AutoCloseable
,org.apache.commons.vfs2.RandomAccessContent
public class HdfsRandomAccessContent
extends org.apache.commons.vfs2.provider.AbstractRandomAccessContent
Provides random access to content in an HdfsFileObject. Currently this only supports read operations. All write
operations throw an
UnsupportedOperationException
.- Since:
- 2.1
-
Constructor Summary
ConstructorsConstructorDescriptionHdfsRandomAccessContent
(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs) Create random access content. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
long
long
length()
boolean
byte
readByte()
char
readChar()
double
float
void
readFully
(byte[] b) void
readFully
(byte[] b, int off, int len) int
readInt()
readLine()
long
readLong()
short
int
int
readUTF()
void
seek
(long pos) void
setLength
(long newLength) int
skipBytes
(int n) Methods inherited from class org.apache.commons.vfs2.provider.AbstractRandomAccessContent
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Constructor Details
-
HdfsRandomAccessContent
public HdfsRandomAccessContent(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileSystem fs) throws IOException Create random access content.- Parameters:
path
- A Hadoop Pathfs
- A Hadoop FileSystem- Throws:
IOException
- when the path cannot be processed.
-
-
Method Details
-
close
- Throws:
IOException
- See Also:
-
RandomAccessContent.close()
-
getFilePointer
- Throws:
IOException
- See Also:
-
RandomAccessContent.getFilePointer()
-
getInputStream
- Throws:
IOException
- See Also:
-
RandomAccessContent.getInputStream()
-
length
- Throws:
IOException
- See Also:
-
RandomAccessContent.length()
-
readBoolean
- Throws:
IOException
- See Also:
-
readByte
- Throws:
IOException
- See Also:
-
readChar
- Throws:
IOException
- See Also:
-
readDouble
- Throws:
IOException
- See Also:
-
readFloat
- Throws:
IOException
- See Also:
-
readFully
- Throws:
IOException
- See Also:
-
readFully
- Throws:
IOException
- See Also:
-
readInt
- Throws:
IOException
- See Also:
-
readLine
- Specified by:
readLine
in interfaceDataInput
- Overrides:
readLine
in classorg.apache.commons.vfs2.provider.AbstractRandomAccessContent
- Throws:
IOException
- See Also:
-
readLong
- Throws:
IOException
- See Also:
-
readShort
- Throws:
IOException
- See Also:
-
readUnsignedByte
- Throws:
IOException
- See Also:
-
readUnsignedShort
- Throws:
IOException
- See Also:
-
readUTF
- Throws:
IOException
- See Also:
-
seek
- Throws:
IOException
- See Also:
-
RandomAccessContent.seek(long)
-
setLength
- Throws:
IOException
- See Also:
-
RandomAccessContent.setLength(long)
-
skipBytes
- Throws:
IOException
- See Also:
-