org.eclipse.jgit.util
Class RawCharUtil

java.lang.Object
  extended by org.eclipse.jgit.util.RawCharUtil

public class RawCharUtil
extends Object

Utility class for character functions on raw bytes

Characters are assumed to be 8-bit US-ASCII.


Method Summary
static boolean isWhitespace(byte c)
          Determine if an 8-bit US-ASCII encoded character is represents whitespace
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.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 for
start - the start of the section of bytes
end - 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 for
start - the start of the section of bytes
end - the end of the section of bytes
Returns:
the new start point


Copyright © 2012. All Rights Reserved.