java.lang.Object
io.helidon.common.buffers.Bytes
Bytes commonly used in HTTP.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
&
byte.static final byte
:
byte.static final byte
\r
(carriage return) byte.static final byte
=
byte.static final byte
#
byte.static final byte
\n
(new line) byte.static final byte
%
byte.static final byte
?
byte.static final byte
;
byte.static final byte
/
byte.static final byte
static final byte
Horizontal tabulator byte. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
firstIndexOf
(byte[] buffer, int fromIndex, int toIndex, byte value) This is using a SWAR (SIMD Within A Register) batch read technique to minimize bound-checks and improve memory usage while searching forvalue
.static long
toWord
(byte[] buffer, int offset) Converts the first 8 bytes fromoffset
to a long, using appropriate byte order for this machine.
-
Field Details
-
COLON_BYTE
public static final byte COLON_BYTE:
byte.- See Also:
-
SPACE_BYTE
public static final byte SPACE_BYTE- See Also:
-
LF_BYTE
public static final byte LF_BYTE\n
(new line) byte.- See Also:
-
CR_BYTE
public static final byte CR_BYTE\r
(carriage return) byte.- See Also:
-
SLASH_BYTE
public static final byte SLASH_BYTE/
byte.- See Also:
-
SEMICOLON_BYTE
public static final byte SEMICOLON_BYTE;
byte.- See Also:
-
QUESTION_MARK_BYTE
public static final byte QUESTION_MARK_BYTE?
byte.- See Also:
-
HASH_BYTE
public static final byte HASH_BYTE#
byte.- See Also:
-
EQUALS_BYTE
public static final byte EQUALS_BYTE=
byte.- See Also:
-
AMPERSAND_BYTE
public static final byte AMPERSAND_BYTE&
byte.- See Also:
-
PERCENT_BYTE
public static final byte PERCENT_BYTE%
byte.- See Also:
-
TAB_BYTE
public static final byte TAB_BYTEHorizontal tabulator byte.- See Also:
-
-
Method Details
-
firstIndexOf
public static int firstIndexOf(byte[] buffer, int fromIndex, int toIndex, byte value) This is using a SWAR (SIMD Within A Register) batch read technique to minimize bound-checks and improve memory usage while searching forvalue
.This method does NOT do a bound check on the buffer length and the fromIndex and toIndex, neither does it check if the
toIndex
is bigger than thefromIndex
.- Parameters:
buffer
- the byte buffer to searchfromIndex
- first index in the arraytoIndex
- last index in the arrayvalue
- to search for- Returns:
- first index of the desired byte
value
, or-1
if not found
-
toWord
public static long toWord(byte[] buffer, int offset) Converts the first 8 bytes fromoffset
to a long, using appropriate byte order for this machine.- This method DOES NOT do a bound check
- This method DOES NOT validate there are 8 bytes available
- Parameters:
buffer
- bytes to convertoffset
- offset within the byte array- Returns:
- long word from the first 8 bytes from offset
-