Skip to content

Commit

Permalink
Revert "Add inputstream class (#28)"
Browse files Browse the repository at this point in the history
This reverts commit b8b6038.
  • Loading branch information
lynnro314 committed Jun 26, 2023
1 parent b8b6038 commit 446619d
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions src/main/java/io/lakefs/iceberg/LakeFSInputFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import org.apache.iceberg.io.InputFile;
import org.apache.iceberg.io.SeekableInputStream;

import java.io.IOException;
import static java.util.Objects.requireNonNull;

public class LakeFSInputFile implements InputFile {
private final InputFile wrapped;

Expand All @@ -26,44 +23,11 @@ public long getLength(){

@Override
public SeekableInputStream newStream(){
return new LakeFSInputStream(wrapped.newStream());
return wrapped.newStream();
}

@Override
public boolean exists(){
return wrapped.exists();
}

private static class LakeFSInputStream extends SeekableInputStream {
private final SeekableInputStream wrapped;

public LakeFSInputStream(SeekableInputStream wrapped) {
this.wrapped = requireNonNull(wrapped, "wrapped is null");
}

@Override
public int read() throws IOException {
return wrapped.read();
}

@Override
public int read(byte[] b, int off, int len) throws IOException {
return wrapped.read(b, off, len);
}

@Override
public long getPos() throws IOException {
return wrapped.getPos();
}

@Override
public void seek(long newPos) throws IOException {
wrapped.seek(newPos);
}

@Override
public void close() throws IOException {
wrapped.close();
}
}
}

0 comments on commit 446619d

Please sign in to comment.