-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The total() method should return long instead of int (fixes issue #142)
- Loading branch information
Showing
2 changed files
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,8 @@ | |
* | ||
* @author Nathan Sweet <[email protected]> */ | ||
public class Output extends OutputStream { | ||
protected int maxCapacity, total; | ||
protected int maxCapacity; | ||
protected long total; | ||
protected int position; | ||
protected int capacity; | ||
protected byte[] buffer; | ||
|
@@ -123,7 +124,7 @@ public void setPosition (int position) { | |
} | ||
|
||
/** Returns the total number of bytes written. This may include bytes that have not been flushed. */ | ||
final public int total () { | ||
final public long total () { | ||
return total + position; | ||
} | ||
|
||
|
@@ -343,7 +344,7 @@ public void writeString (String value) throws KryoException { | |
if (charIndex < charCount) writeString_slow(value, charCount, charIndex); | ||
} | ||
} | ||
|
||
/** Writes the length and CharSequence as UTF8, or null. The string can be read using {@link Input#readString()} or | ||
* {@link Input#readStringBuilder()}. | ||
* @param value May be null. */ | ||
|