Fix range download (again)
This commit is contained in:
@@ -119,6 +119,53 @@ class FileServeInputStream extends InputStream {
|
||||
this.remaining = endRange + 1 - startRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int available() throws IOException {
|
||||
return this.is.available();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
this.is.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] buffer, int off, int len) throws IOException {
|
||||
if (this.remaining == 0) {
|
||||
this.is.close();
|
||||
return -1;
|
||||
} else {
|
||||
int read = this.is.read(buffer, off, (int) Math.min(len, this.remaining));
|
||||
this.remaining -= read;
|
||||
return read;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] readAllBytes() throws IOException {
|
||||
return this.is.readAllBytes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] readNBytes(int arg0) throws IOException {
|
||||
return this.is.readNBytes(arg0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int readNBytes(byte[] arg0, int arg1, int arg2) throws IOException {
|
||||
return this.is.readNBytes(arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long skip(long arg0) throws IOException {
|
||||
return this.is.skip(arg0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void skipNBytes(long arg0) throws IOException {
|
||||
this.is.skipNBytes(arg0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] buffer) throws IOException {
|
||||
if (this.remaining == 0) {
|
||||
|
||||
@@ -10,6 +10,7 @@ quarkus:
|
||||
native:
|
||||
container-build: true
|
||||
container-runtime: docker
|
||||
builder-image: quay.io/quarkus/ubi-quarkus-mandrel:22.3-java17
|
||||
enable-all-security-services: true
|
||||
enable-https-url-handler: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user