com.iprogrammerr.gentle.request.initialization.FileContent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gentle-request Show documentation
Show all versions of gentle-request Show documentation
Compact library for creating and reading http requests.
The newest version!
package com.iprogrammerr.gentle.request.initialization;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import com.iprogrammerr.gentle.request.binary.PacketsBinary;
public final class FileContent implements UnreliableInitialization {
private final File source;
public FileContent(File source) {
this.source = source;
}
@Override
public byte[] value() throws Exception {
try (BufferedInputStream is = new BufferedInputStream(new FileInputStream(this.source))) {
return new PacketsBinary(is, this.source.length()).content();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy