|
@@ -18,6 +18,8 @@
|
|
package org.apache.hadoop.fs;
|
|
package org.apache.hadoop.fs;
|
|
|
|
|
|
import java.io.BufferedInputStream;
|
|
import java.io.BufferedInputStream;
|
|
|
|
+import java.io.FileDescriptor;
|
|
|
|
+import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
|
|
import org.apache.hadoop.classification.InterfaceAudience;
|
|
import org.apache.hadoop.classification.InterfaceAudience;
|
|
@@ -31,7 +33,7 @@ import org.apache.hadoop.classification.InterfaceStability;
|
|
@InterfaceAudience.Private
|
|
@InterfaceAudience.Private
|
|
@InterfaceStability.Unstable
|
|
@InterfaceStability.Unstable
|
|
public class BufferedFSInputStream extends BufferedInputStream
|
|
public class BufferedFSInputStream extends BufferedInputStream
|
|
-implements Seekable, PositionedReadable {
|
|
|
|
|
|
+implements Seekable, PositionedReadable, HasFileDescriptor {
|
|
/**
|
|
/**
|
|
* Creates a <code>BufferedFSInputStream</code>
|
|
* Creates a <code>BufferedFSInputStream</code>
|
|
* with the specified buffer size,
|
|
* with the specified buffer size,
|
|
@@ -97,4 +99,13 @@ implements Seekable, PositionedReadable {
|
|
public void readFully(long position, byte[] buffer) throws IOException {
|
|
public void readFully(long position, byte[] buffer) throws IOException {
|
|
((FSInputStream)in).readFully(position, buffer);
|
|
((FSInputStream)in).readFully(position, buffer);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public FileDescriptor getFileDescriptor() throws IOException {
|
|
|
|
+ if (in instanceof HasFileDescriptor) {
|
|
|
|
+ return ((HasFileDescriptor) in).getFileDescriptor();
|
|
|
|
+ } else {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|