Package org.apache.fluo.api.data
Class Bytes.BytesBuilder
- java.lang.Object
-
- org.apache.fluo.api.data.Bytes.BytesBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bytes.BytesBuilder
append(byte[] bytes)
Bytes.BytesBuilder
append(byte[] bytes, int offset, int length)
Append a section of bytes from arrayBytes.BytesBuilder
append(int b)
Append a single byte.Bytes.BytesBuilder
append(InputStream in, int length)
Append a sequence of bytes from an InputStreamBytes.BytesBuilder
append(CharSequence cs)
Bytes.BytesBuilder
append(String s)
Converts string to bytes using UTF-8 encoding and appends bytes.Bytes.BytesBuilder
append(ByteBuffer bb)
Append data from a ByteBufferBytes.BytesBuilder
append(Bytes b)
int
getLength()
void
setLength(int newLen)
Sets the point at which appending will start.Bytes
toBytes()
-
-
-
Method Detail
-
append
public Bytes.BytesBuilder append(CharSequence cs)
-
append
public Bytes.BytesBuilder append(String s)
Converts string to bytes using UTF-8 encoding and appends bytes.- Returns:
- self
-
append
public Bytes.BytesBuilder append(Bytes b)
-
append
public Bytes.BytesBuilder append(byte[] bytes)
-
append
public Bytes.BytesBuilder append(int b)
Append a single byte.- Parameters:
b
- take the lower 8 bits and appends it.- Returns:
- self
-
append
public Bytes.BytesBuilder append(byte[] bytes, int offset, int length)
Append a section of bytes from array- Parameters:
bytes
- - bytes to be appendedoffset
- - start of bytes to be appendedlength
- - how many bytes from 'offset' to be appended- Returns:
- self
-
append
public Bytes.BytesBuilder append(InputStream in, int length) throws IOException
Append a sequence of bytes from an InputStream- Parameters:
in
- data source to append fromlength
- number of bytes to read from data source- Returns:
- self
- Throws:
IOException
-
append
public Bytes.BytesBuilder append(ByteBuffer bb)
Append data from a ByteBuffer- Parameters:
bb
- data is read from the ByteBuffer in such a way that its position is not changed.- Returns:
- self
-
setLength
public void setLength(int newLen)
Sets the point at which appending will start. This method can shrink or grow the ByteBuilder from its current state. If it grows it will zero pad.
-
getLength
public int getLength()
-
toBytes
public Bytes toBytes()
-
-