Package org.fusesource.hawtbuf
Class Buffer
java.lang.Object
org.fusesource.hawtbuf.Buffer
- All Implemented Interfaces:
Comparable<Buffer>
- Direct Known Subclasses:
AsciiBuffer
,UTF8Buffer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal AsciiBuffer
ascii()
static AsciiBuffer
static AsciiBuffer
final BufferEditor
final Buffer
buffer()
final Buffer
clear()
final Buffer
compact()
int
final boolean
contains
(byte value) final boolean
containsAt
(Buffer needle, int pos) final Buffer
data
(byte[] data) final Buffer
deepCopy()
boolean
final boolean
final Buffer
flip()
final byte
get
(int i) final byte[]
getData()
final int
final int
int
hashCode()
hex()
final BufferInputStream
in()
final int
indexOf
(byte value) final int
indexOf
(byte value, int pos) final int
final int
final boolean
isEmpty()
static final Buffer
final int
length()
final Buffer
length
(int length) final BufferEditor
private final boolean
final Buffer
moveHead
(int value) final Buffer
moveTail
(int value) final Buffer
offset
(int offset) final BufferOutputStream
out()
void
same as in.readFully(data, offset, length);int
readFrom
(InputStream in) same as in.read(data, offset, length);void
reset()
final Buffer
slice
(int low, int high) final Buffer[]
split
(byte separator) final boolean
startsWith
(Buffer other) static String
final byte[]
toString()
final Buffer
trim()
final Buffer
trimEnd()
final Buffer
final UTF8Buffer
utf8()
static UTF8Buffer
static UTF8Buffer
void
writeTo
(DataOutput out) same as out.write(data, offset, length);void
writeTo
(OutputStream out) same as out.write(data, offset, length);
-
Field Details
-
data
public byte[] data -
offset
public int offset -
length
public int length
-
-
Constructor Details
-
Buffer
-
Buffer
-
Buffer
public Buffer(int size) -
Buffer
public Buffer(byte[] data) -
Buffer
public Buffer(byte[] data, int offset, int length)
-
-
Method Details
-
hex
-
flip
-
moveHead
-
moveTail
-
clear
-
slice
-
getData
public final byte[] getData() -
data
-
getLength
public final int getLength() -
length
public final int length() -
length
-
getOffset
public final int getOffset() -
offset
-
deepCopy
-
compact
-
toByteArray
public final byte[] toByteArray() -
get
public final byte get(int i) -
equals
-
in
-
out
-
bigEndianEditor
-
littleEndianEditor
-
isEmpty
public final boolean isEmpty() -
contains
public final boolean contains(byte value) -
indexOf
public final int indexOf(byte value) -
indexOf
public final int indexOf(byte value, int pos) -
startsWith
-
indexOf
-
indexOf
-
containsAt
-
matches
-
trim
-
trimEnd
-
trimFront
-
buffer
-
ascii
-
utf8
-
split
-
reset
public void reset() -
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Buffer>
-
writeTo
same as out.write(data, offset, length);- Throws:
IOException
-
writeTo
same as out.write(data, offset, length);- Throws:
IOException
-
readFrom
same as in.readFully(data, offset, length);- Throws:
IOException
-
readFrom
same as in.read(data, offset, length);- Throws:
IOException
-
string
-
join
-
toByteBuffer
-
ascii
-
ascii
-
utf8
-
utf8
-
toString
-