Created
November 2, 2018 19:20
-
-
Save ebuildy/e91ac6af2ff8a6b1821d18abf2f8c9e1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public void setLength(int newLength) { | |
if (newLength < 0) | |
throw new StringIndexOutOfBoundsException(newLength); | |
ensureCapacityInternal(newLength); | |
if (count < newLength) { | |
Arrays.fill(value, count, newLength, '\0'); | |
} | |
count = newLength; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment