public class Msg extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Msg.Builder |
| Modifier and Type | Field and Description |
|---|---|
static int |
COMMAND |
static int |
CREDENTIAL |
static int |
IDENTITY |
static int |
MORE |
static int |
SHARED |
| Constructor and Description |
|---|
Msg() |
Msg(byte[] src) |
Msg(ByteBuffer src) |
Msg(int capacity) |
Msg(Msg m) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
buf() |
boolean |
check() |
byte[] |
data()
Returns the message data.
|
SocketChannel |
fd() |
int |
flags() |
byte |
get() |
byte |
get(int index) |
int |
getBytes(int index,
byte[] dst,
int off,
int len) |
int |
getBytes(int index,
ByteBuffer bb,
int len) |
int |
getInt(int offset) |
long |
getLong(int offset) |
Metadata |
getMetadata() |
int |
getShort(int offset) |
protected int |
getWriteIndex() |
boolean |
hasMore() |
void |
initDelimiter() |
boolean |
isCommand() |
boolean |
isCredential() |
boolean |
isDelimiter() |
boolean |
isIdentity() |
Msg |
put(byte b) |
Msg |
put(byte[] src) |
Msg |
put(byte[] src,
int off,
int len) |
Msg |
put(ByteBuffer src) |
Msg |
put(ByteBuffer src,
int off,
int len) |
Msg |
put(int b) |
protected Msg |
put(int index,
byte b) |
Msg |
putShortString(String data)
Puts a string into the message, prefixed with its length.
|
void |
resetFlags(int f) |
void |
resetMetadata() |
void |
setFd(SocketChannel fileDesc) |
void |
setFlags(int flags) |
Msg |
setMetadata(Metadata metadata) |
protected void |
setWriteIndex(int writeIndex) |
int |
size() |
String |
toString() |
void |
transfer(ByteBuffer destination,
int srcOffset,
int srcLength) |
public static final int MORE
public static final int COMMAND
public static final int CREDENTIAL
public static final int IDENTITY
public static final int SHARED
public Msg()
public Msg(int capacity)
public Msg(byte[] src)
public Msg(ByteBuffer src)
public Msg(Msg m)
public boolean isIdentity()
public boolean isDelimiter()
public boolean check()
public int flags()
public boolean hasMore()
public boolean isCommand()
public boolean isCredential()
public void setFlags(int flags)
public void initDelimiter()
public byte[] data()
public ByteBuffer buf()
public int size()
public void resetFlags(int f)
public void setFd(SocketChannel fileDesc)
public SocketChannel fd()
public Metadata getMetadata()
public void resetMetadata()
public byte get()
public byte get(int index)
public Msg put(byte b)
public Msg put(int b)
protected Msg put(int index, byte b)
public Msg put(byte[] src)
public Msg put(byte[] src, int off, int len)
public Msg put(ByteBuffer src, int off, int len)
public Msg put(ByteBuffer src)
public int getBytes(int index,
byte[] dst,
int off,
int len)
public int getBytes(int index,
ByteBuffer bb,
int len)
protected final int getWriteIndex()
protected final void setWriteIndex(int writeIndex)
public long getLong(int offset)
public int getInt(int offset)
public int getShort(int offset)
public void transfer(ByteBuffer destination, int srcOffset, int srcLength)
public Msg putShortString(String data)
data - a string shorter than 256 characters. If null, defaults to a no-op.Copyright © 2020. All rights reserved.