Package com.clickhouse.client
Class ClickHouseByteBuffer
- java.lang.Object
-
- com.clickhouse.client.ClickHouseByteBuffer
-
- All Implemented Interfaces:
Serializable
public class ClickHouseByteBuffer extends Object implements Serializable
Lite version ofByteBuffer
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
array
static ByteBuffer
EMPTY_BUFFER
Empty and read-only byte buffer.static byte[]
EMPTY_BYTES
Empty byte array.protected int
length
protected int
position
-
Constructor Summary
Constructors Modifier Constructor Description protected
ClickHouseByteBuffer(byte[] bytes, int offset, int length)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
array()
boolean
equals(Object obj)
int
hashCode()
boolean
isEmpty()
int
length()
int
limit()
static ClickHouseByteBuffer
newInstance()
Creates an empty byte buffer.static ClickHouseByteBuffer
of(byte[] bytes)
Wraps given byte array as byte buffer.static ClickHouseByteBuffer
of(byte[] bytes, int offset, int length)
Wraps given byte array as byte buffer.int
position()
ClickHouseByteBuffer
reset()
String
toString()
ClickHouseByteBuffer
update(byte[] bytes)
ClickHouseByteBuffer
update(byte[] bytes, int offset, int length)
-
-
-
Field Detail
-
EMPTY_BYTES
public static final byte[] EMPTY_BYTES
Empty byte array.
-
EMPTY_BUFFER
public static final ByteBuffer EMPTY_BUFFER
Empty and read-only byte buffer.
-
array
protected byte[] array
-
position
protected int position
-
length
protected int length
-
-
Method Detail
-
newInstance
public static ClickHouseByteBuffer newInstance()
Creates an empty byte buffer.- Returns:
- empty byte buffer
-
of
public static ClickHouseByteBuffer of(byte[] bytes)
Wraps given byte array as byte buffer.- Parameters:
bytes
- byte array- Returns:
- byte buffer
-
of
public static ClickHouseByteBuffer of(byte[] bytes, int offset, int length)
Wraps given byte array as byte buffer.- Parameters:
bytes
- byte arrayoffset
- offsetlength
- length- Returns:
- byte buffer
-
isEmpty
public boolean isEmpty()
-
reset
public ClickHouseByteBuffer reset()
-
update
public ClickHouseByteBuffer update(byte[] bytes)
-
update
public ClickHouseByteBuffer update(byte[] bytes, int offset, int length)
-
array
public byte[] array()
-
position
public int position()
-
length
public int length()
-
limit
public int limit()
-
-