Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

3 changed files with 9 additions and 12 deletions

View file

@ -1,3 +0,0 @@
.* @orikik
.forgejo/.* @potyarkin
Makefile @potyarkin

View file

@ -6,7 +6,7 @@ import info.frostfs.sdk.dto.session.SessionToken;
import lombok.Getter;
import lombok.Setter;
import java.io.InputStream;
import java.io.FileInputStream;
@Getter
@Setter
@ -16,7 +16,7 @@ public class PutObjectParameters {
private ObjectHeader header;
@NotNull
private InputStream payload;
private FileInputStream payload;
private boolean clientCut;
private int bufferMaxSize;
@ -26,14 +26,14 @@ public class PutObjectParameters {
private long currentStreamPosition;
private long fullLength;
public PutObjectParameters(ObjectHeader header, InputStream payload, boolean clientCut, int bufferMaxSize) {
public PutObjectParameters(ObjectHeader header, FileInputStream payload, boolean clientCut, int bufferMaxSize) {
this.header = header;
this.payload = payload;
this.clientCut = clientCut;
this.bufferMaxSize = bufferMaxSize;
}
public PutObjectParameters(ObjectHeader header, InputStream payload) {
public PutObjectParameters(ObjectHeader header, FileInputStream payload) {
this.header = header;
this.payload = payload;
}

View file

@ -31,8 +31,8 @@ import info.frostfs.sdk.tools.Verifier;
import info.frostfs.sdk.utils.Validator;
import org.apache.commons.collections4.CollectionUtils;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
@ -329,17 +329,17 @@ public class ObjectClientImpl extends ContextAccessor implements ObjectClient {
return new SearchReader(objectServiceBlockingClient.search(initRequest));
}
private int readNBytes(InputStream inputStream, byte[] buffer, int size) {
private int readNBytes(FileInputStream fileInputStream, byte[] buffer, int size) {
try {
return inputStream.readNBytes(buffer, 0, size);
return fileInputStream.readNBytes(buffer, 0, size);
} catch (IOException exp) {
throw new ProcessFrostFSException(exp.getMessage());
}
}
private long getStreamSize(InputStream inputStream) {
private long getStreamSize(FileInputStream fileInputStream) {
try {
return inputStream.available();
return fileInputStream.getChannel().size();
} catch (IOException exp) {
throw new ProcessFrostFSException(exp.getMessage());
}