Class WireProtocolMessage
java.lang.Object
de.caluga.morphium.driver.wireprotocol.WireProtocolMessage
- Direct Known Subclasses:
OpCompressed,OpDelete,OpGetMore,OpInsert,OpKillCursors,OpMsg,OpQuery,OpReply,OpUpdate
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]bytes()intabstract intabstract byte[]intintgetSize()static WireProtocolMessageabstract voidparsePayload(byte[] bytes, int offset) static intreadInt(byte[] bytes, int idx) static longreadLong(byte[] bytes, int idx) static StringreadString(byte[] bytes, int idx) voidsetMessageId(int messageId) voidsetResponseTo(int responseTo) voidsetSize(int size) static intstrLen(byte[] bytes, int idx) voidwriteInt(int value, OutputStream to) static voidwriteLong(long lng, OutputStream out) voidwriteString(String n, OutputStream to)
-
Constructor Details
-
WireProtocolMessage
public WireProtocolMessage()
-
-
Method Details
-
parseFromStream
-
readString
-
strLen
public static int strLen(byte[] bytes, int idx) -
readInt
public static int readInt(byte[] bytes, int idx) -
readLong
public static long readLong(byte[] bytes, int idx) -
writeLong
- Throws:
IOException
-
parsePayload
- Throws:
IOException
-
getPayload
- Throws:
IOException
-
getOpCode
public abstract int getOpCode() -
bytes
- Throws:
IOException
-
getSize
public int getSize() -
setSize
public void setSize(int size) -
getMessageId
public int getMessageId() -
setMessageId
public void setMessageId(int messageId) -
getResponseTo
public int getResponseTo() -
setResponseTo
public void setResponseTo(int responseTo) -
writeInt
- Throws:
IOException
-
writeString
- Throws:
IOException
-