Modifier and Type | Method and Description |
---|---|
Bytes.BytesBuilder |
append(byte[] bytes) |
Bytes.BytesBuilder |
append(byte[] bytes,
int offset,
int length)
Append a section of bytes from array
|
Bytes.BytesBuilder |
append(ByteBuffer bb)
Append data from a ByteBuffer
|
Bytes.BytesBuilder |
append(Bytes b) |
Bytes.BytesBuilder |
append(CharSequence cs) |
Bytes.BytesBuilder |
append(InputStream in,
int length)
Append a sequence of bytes from an InputStream
|
Bytes.BytesBuilder |
append(int b)
Append a single byte.
|
Bytes.BytesBuilder |
append(String s)
Converts string to bytes using UTF-8 encoding and appends bytes.
|
int |
getLength() |
void |
setLength(int newLen)
Sets the point at which appending will start.
|
Bytes |
toBytes() |
public Bytes.BytesBuilder append(CharSequence cs)
public Bytes.BytesBuilder append(String s)
public Bytes.BytesBuilder append(Bytes b)
public Bytes.BytesBuilder append(byte[] bytes)
public Bytes.BytesBuilder append(int b)
b
- take the lower 8 bits and appends it.public Bytes.BytesBuilder append(byte[] bytes, int offset, int length)
bytes
- - bytes to be appendedoffset
- - start of bytes to be appendedlength
- - how many bytes from 'offset' to be appendedpublic Bytes.BytesBuilder append(InputStream in, int length) throws IOException
in
- data source to append fromlength
- number of bytes to read from data sourceIOException
public Bytes.BytesBuilder append(ByteBuffer bb)
bb
- data is read from the ByteBuffer in such a way that its position is not changed.public void setLength(int newLen)
public int getLength()
public Bytes toBytes()
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.