| Constructor and Description |
|---|
Strings() |
| Modifier and Type | Method and Description |
|---|---|
int |
copyStringToChars(String str,
char[] dst,
int dstBegin,
int dstEnd)
Copies characters from the string into the character array.
|
private int |
naiveCopyStringToChars(String str,
char[] dst,
int dstBegin,
int dstEnd)
Copies characters from the string into the character array.
|
private int |
safeCopyStringToChars(String str,
char[] dst,
int dstBegin,
int dstEnd)
Copies characters from the string into the character array.
|
void |
write(char[] c,
int len)
Log a message.
|
void |
writeThreadId(char[] c,
int len)
Log a thread identifier and a message.
|
public Strings()
public void writeThreadId(char[] c, int len)
StringswriteThreadId in class Stringsc - character array with message starting at index 0len - number of characters in messagepublic int copyStringToChars(String str, char[] dst, int dstBegin, int dstEnd)
StringsTODO: There are special memory management semantics here that someone should document.
copyStringToChars in class Stringsstr - the source stringdst - the destination arraydstBegin - the start offset in the destination arraydstEnd - the index after the last character in the
destination to copy toprivate int safeCopyStringToChars(String str, char[] dst, int dstBegin, int dstEnd)
TODO: There are special memory management semantics here that someone should document.
str - the source stringdst - the destination arraydstBegin - the start offset in the destination arraydstEnd - the index after the last character in the
destination to copy toprivate int naiveCopyStringToChars(String str, char[] dst, int dstBegin, int dstEnd)
str - the source stringdst - the destination arraydstBegin - the start offset in the destination arraydstEnd - the index after the last character in the
destination to copy to