Skip to content

Commit

Permalink
Change BaseWriteChannel.position type to long to fix overflow (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Nov 11, 2016
1 parent 6383cc1 commit 89f83f3
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit 89f83f3

Please sign in to comment.