Top Description Fields Constructors Methods
org.eclipse.jgit.util

public Class RawCharUtil

extends Object
Class Inheritance

Utility class for character functions on raw bytes

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

Field Summary

Modifier and TypeField and Description
private static final boolean[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if c represents a whitespace character in 8-bit US-ASCII
isWhitespace
(byte
the 8-bit US-ASCII encoded character
c
)

Determine if an 8-bit US-ASCII encoded character is represents whitespace

public static int

Returns:

the new start point
trimLeadingWhitespace
(byte[]
the byte array containing the portion to trim whitespace for
raw
,
int
the start of the section of bytes
start
,
int
the end of the section of bytes
end
)

Returns the new start point for the byte array passed in after trimming any leading whitespace characters, as determined by the isWhitespace() function.

public static int

Returns:

the new end point
trimTrailingWhitespace
(byte[]
the byte array containing the portion to trim whitespace for
raw
,
int
the start of the section of bytes
start
,
int
the end of the section of bytes
end
)

Returns the new end point for the byte array passed in after trimming any trailing whitespace characters, as determined by the isWhitespace() function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

WHITESPACEback to summary
private static final boolean[] WHITESPACE

Constructor Detail

RawCharUtilback to summary
private RawCharUtil()

Method Detail

isWhitespaceback to summary
public static boolean isWhitespace(byte c)

Determine if an 8-bit US-ASCII encoded character is represents whitespace

Parameters
c:byte

the 8-bit US-ASCII encoded character

Returns:boolean

true if c represents a whitespace character in 8-bit US-ASCII

trimLeadingWhitespaceback to summary
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:byte[]

the byte array containing the portion to trim whitespace for

start:int

the start of the section of bytes

end:int

the end of the section of bytes

Returns:int

the new start point

trimTrailingWhitespaceback to summary
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:byte[]

the byte array containing the portion to trim whitespace for

start:int

the start of the section of bytes

end:int

the end of the section of bytes

Returns:int

the new end point