Package org.eclipse.jgit.util
Class RawCharUtil
java.lang.Object
org.eclipse.jgit.util.RawCharUtil
Utility class for character functions on raw bytes
Characters are assumed to be 8-bit US-ASCII.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Field Details
-
WHITESPACE
private static final boolean[] WHITESPACE
-
-
Constructor Details
-
RawCharUtil
private RawCharUtil()
-
-
Method Details
-
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
-