You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/06/29 10:08:05 UTC
svn commit: r789250 -
/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Ascii.java
Author: mturk
Date: Mon Jun 29 08:08:05 2009
New Revision: 789250
URL: http://svn.apache.org/viewvc?rev=789250&view=rev
Log:
Update javadocs
Modified:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Ascii.java
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Ascii.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Ascii.java?rev=789250&r1=789249&r2=789250&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Ascii.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Ascii.java Mon Jun 29 08:08:05 2009
@@ -259,6 +259,21 @@
arr[i] = (byte)ccs_cupper[(int)arr[i] & 0xff];
}
+ /**
+ * Convert characters in {@code arr} byte array to integer.
+ * <p>
+ * Skip white space and pick up leading {@code +/-} sign if any.
+ * If base is {@code 0}, allow {@code 0x} for hex and {@code 0} for octal,
+ * else assume decimal; if base is already {@code 16}, allow {@code 0x}.
+ * </p>
+ *
+ * @param arr input byte array
+ * @param srcPos starting position in the input array.
+ * @param len use at most {@code len} characters.
+ * @param base number base to use {@code (2 - 36)} or {@code 0} for guess.
+ *
+ * @return integer value of the {@code Ascii} string pointed by {@code arr}.
+ */
public static int atoi(byte[] arr, int srcPos, int len, int base)
{
int acc;
@@ -348,6 +363,21 @@
return acc;
}
+ /**
+ * Convert characters in {@code arr} byte array to long.
+ * <p>
+ * Skip white space and pick up leading {@code +/-} sign if any.
+ * If base is {@code 0}, allow {@code 0x} for hex and {@code 0} for octal,
+ * else assume decimal; if base is already {@code 16}, allow {@code 0x}.
+ * </p>
+ *
+ * @param arr input byte array
+ * @param srcPos starting position in the input array.
+ * @param len use at most {@code len} characters.
+ * @param base number base to use {@code (2 - 36)} or {@code 0} for guess.
+ *
+ * @return long value of the {@code Ascii} string pointed by {@code arr}.
+ */
public static long atol(byte[] arr, int srcPos, int len, int base)
{
long acc;