Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change BaseWriteChannel.position type to long to fix overflow #1390

Merged
merged 1 commit into from
Nov 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public abstract class BaseWriteChannel<
private final ServiceOptionsT options;
private final EntityT entity;
private final String uploadId;
private int position;
private long position;
private byte[] buffer = new byte[0];
private int limit;
private boolean isOpen = true;
Expand Down Expand Up @@ -101,11 +101,11 @@ protected String getUploadId() {
}

@Deprecated
protected int position() {
protected long position() {
return getPosition();
}

protected int getPosition() {
protected long getPosition() {
return position;
}

Expand All @@ -119,7 +119,7 @@ protected byte[] getBuffer() {
}

@Deprecated
protected int limit() {
protected long limit() {
return getLimit();
}

Expand Down Expand Up @@ -245,7 +245,7 @@ protected abstract static class BaseState<
protected final ServiceOptionsT serviceOptions;
protected final EntityT entity;
protected final String uploadId;
protected final int position;
protected final long position;
protected final byte[] buffer;
protected final boolean isOpen;
protected final int chunkSize;
Expand Down Expand Up @@ -274,7 +274,7 @@ public abstract static class Builder<
private final ServiceOptionsT serviceOptions;
private final EntityT entity;
private final String uploadId;
private int position;
private long position;
private byte[] buffer;
private boolean isOpen;
private int chunkSize;
Expand All @@ -290,7 +290,7 @@ public Builder<ServiceOptionsT, EntityT> position(int position) {
return setPosition(position);
}

public Builder<ServiceOptionsT, EntityT> setPosition(int position) {
public Builder<ServiceOptionsT, EntityT> setPosition(long position) {
this.position = position;
return this;
}
Expand Down