parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopStreams.java
public static SeekableInputStream wrap(FSDataInputStream stream) {
    Preconditions.checkNotNull(stream, "Cannot wrap a null input stream");
    if (byteBufferReadableClass != null && h2SeekableConstructor != null &&
        byteBufferReadableClass.isInstance(stream.getWrappedStream())) {
      try {
        return h2SeekableConstructor.newInstance(stream);
      } catch (InstantiationException e) {
        LOG.warn("Could not instantiate H2SeekableInputStream, falling back to byte array reads", e);
        return new H1SeekableInputStream(stream);
      } catch (IllegalAccessException e) {
        LOG.warn("Could not instantiate H2SeekableInputStream, falling back to byte array reads", e);
        return new H1SeekableInputStream(stream);
      } catch (InvocationTargetException e) {
        throw new ParquetDecodingException(
            "Could not instantiate H2SeekableInputStream", e.getTargetException());
      }
    } else {
      return new H1SeekableInputStream(stream);
    }
  }
public static SeekableInputStream wrap(FSDataInputStream stream) {
    Preconditions.checkNotNull(stream, "Cannot wrap a null input stream");
    if (byteBufferReadableClass != null && h2SeekableConstructor != null &&
        byteBufferReadableClass.isInstance(stream.getWrappedStream())) {
      try {
        return h2SeekableConstructor.newInstance(stream);
      } catch (InstantiationException e) {
        LOG.warn("Could not instantiate H2SeekableInputStream, falling back to byte array reads", e);
        return new H1SeekableInputStream(stream);
      } catch (IllegalAccessException e) {
        LOG.warn("Could not instantiate H2SeekableInputStream, falling back to byte array reads", e);
        return new H1SeekableInputStream(stream);
      } catch (InvocationTargetException e) {
        throw new ParquetDecodingException(
            "Could not instantiate H2SeekableInputStream", e.getTargetException());
      }
    } else {
      return new H1SeekableInputStream(stream);
    }
  }
public static SeekableInputStream wrap ( FSDataInputStream stream ) { Preconditions . checkNotNull ( stream , "Cannot wrap a null input stream" ) ; if ( byteBufferReadableClass != null && h2SeekableConstructor != null && byteBufferReadableClass . isInstance ( stream . getWrappedStream ( ) ) ) { try { return h2SeekableConstructor . newInstance ( stream ) ; } catch ( InstantiationException e ) { LOG . warn ( "Could not instantiate H2SeekableInputStream, falling back to byte array reads" , e ) ; return new H1SeekableInputStream ( stream ) ; } catch ( IllegalAccessException e ) { LOG . warn ( "Could not instantiate H2SeekableInputStream, falling back to byte array reads" , e ) ; return new H1SeekableInputStream ( stream ) ; } catch ( InvocationTargetException e ) { throw new ParquetDecodingException ( "Could not instantiate H2SeekableInputStream" , e . getTargetException ( ) ) ; } } else { return new H1SeekableInputStream ( stream ) ; } }
Wraps a {@link FSDataInputStream} in a {@link SeekableInputStream}
implementation for Parquet readers.

@param stream a Hadoop FSDataInputStream
@return a SeekableInputStream
Wraps a { @link FSDataInputStream } in a { @link SeekableInputStream } implementation for Parquet readers .