src/share/classes/sun/misc/JavaLangAccess.java
Print this page
rev 6516 : 8007398: Peformance improvements to Integer and Long string formatting.
Contributed-by: Steven Schlansker <stevenschlansker@gmail.com>
*** 95,100 ****
--- 95,121 ----
/**
* Returns the ith StackTraceElement for the given throwable.
*/
StackTraceElement getStackTraceElement(Throwable t, int i);
+
+ /**
+ * Returns a string backed by the provided character array. The character
+ * array must not be modified after the string is created in order to
+ * fulfill String's contract.
+ *
+ * @param chars the character array to back the string.
+ * @return a newly created string whose content is the character array.
+ */
+ String createStringSharedChars(char[] chars);
+
+ /**
+ * Format a long (treated as unsigned) into a character buffer.
+ * @param val the unsigned long to format
+ * @param shift the log2 of the base to format in (4 for hex, 3 for octal, 1 for binary)
+ * @param buf the character buffer to write to
+ * @param offset the offset in the destination buffer to start at
+ * @param len the number of characters to write
+ * @return the lowest character location used
+ */
+ int formatUnsignedLong(long val, int shift, char[] buf, int offset, int len);
}