Package org.eclipse.jgit.util
Class RawCharUtil
- java.lang.Object
-
- org.eclipse.jgit.util.RawCharUtil
-
public class RawCharUtil extends Object
Utility class for character functions on raw bytesCharacters are assumed to be 8-bit US-ASCII.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isWhitespace(byte c)
Determine if an 8-bit US-ASCII encoded character is represents whitespacestatic int
trimLeadingWhitespace(byte[] raw, int start, int end)
Returns the new start point for the byte array passed in after trimming any leading whitespace characters, as determined by the isWhitespace() function.static int
trimTrailingWhitespace(byte[] raw, int start, int end)
Returns the new end point for the byte array passed in after trimming any trailing whitespace characters, as determined by the isWhitespace() function.
-
-
-
Method Detail
-
isWhitespace
public static boolean isWhitespace(byte c)
Determine if an 8-bit US-ASCII encoded character is represents whitespace- Parameters:
c
- the 8-bit US-ASCII encoded character- Returns:
- true if c represents a whitespace character in 8-bit US-ASCII
-
trimTrailingWhitespace
public static int trimTrailingWhitespace(byte[] raw, int start, int end)
Returns the new end point for the byte array passed in after trimming any trailing whitespace characters, as determined by the isWhitespace() function. start and end are assumed to be within the bounds of raw.- Parameters:
raw
- the byte array containing the portion to trim whitespace forstart
- the start of the section of bytesend
- the end of the section of bytes- Returns:
- the new end point
-
trimLeadingWhitespace
public static int trimLeadingWhitespace(byte[] raw, int start, int end)
Returns the new start point for the byte array passed in after trimming any leading whitespace characters, as determined by the isWhitespace() function. start and end are assumed to be within the bounds of raw.- Parameters:
raw
- the byte array containing the portion to trim whitespace forstart
- the start of the section of bytesend
- the end of the section of bytes- Returns:
- the new start point
-
-