Fix range download (again)
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -12,10 +12,10 @@
|
|||||||
<maven.compiler.target>11</maven.compiler.target>
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<quarkus-plugin.version>2.14.2.Final</quarkus-plugin.version>
|
<quarkus-plugin.version>2.15.0.Final</quarkus-plugin.version>
|
||||||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
||||||
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
|
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
|
||||||
<quarkus.platform.version>2.14.2.Final</quarkus.platform.version>
|
<quarkus.platform.version>2.15.0.Final</quarkus.platform.version>
|
||||||
<surefire-plugin.version>2.22.1</surefire-plugin.version>
|
<surefire-plugin.version>2.22.1</surefire-plugin.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|||||||
@@ -119,6 +119,53 @@ class FileServeInputStream extends InputStream {
|
|||||||
this.remaining = endRange + 1 - startRange;
|
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
|
@Override
|
||||||
public int read(byte[] buffer) throws IOException {
|
public int read(byte[] buffer) throws IOException {
|
||||||
if (this.remaining == 0) {
|
if (this.remaining == 0) {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ quarkus:
|
|||||||
native:
|
native:
|
||||||
container-build: true
|
container-build: true
|
||||||
container-runtime: docker
|
container-runtime: docker
|
||||||
|
builder-image: quay.io/quarkus/ubi-quarkus-mandrel:22.3-java17
|
||||||
enable-all-security-services: true
|
enable-all-security-services: true
|
||||||
enable-https-url-handler: true
|
enable-https-url-handler: true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user