Class WireProtocolMessage
- java.lang.Object
-
- de.caluga.morphium.driver.wireprotocol.WireProtocolMessage
-
- Direct Known Subclasses:
OpCompressed,OpDelete,OpGetMore,OpInsert,OpKillCursors,OpMsg,OpQuery,OpReply,OpUpdate
public abstract class WireProtocolMessage extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWireProtocolMessage.OpCode
-
Constructor Summary
Constructors Constructor Description WireProtocolMessage()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte[]bytes()intgetMessageId()abstract intgetOpCode()abstract byte[]getPayload()intgetResponseTo()intgetSize()static WireProtocolMessageparseFromStream(InputStream in)abstract 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)
-
-
-
Method Detail
-
parseFromStream
public static WireProtocolMessage parseFromStream(InputStream in)
-
readString
public static String readString(byte[] bytes, int idx)
-
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
public static void writeLong(long lng, OutputStream out) throws IOException- Throws:
IOException
-
parsePayload
public abstract void parsePayload(byte[] bytes, int offset) throws IOException- Throws:
IOException
-
getPayload
public abstract byte[] getPayload() throws IOException- Throws:
IOException
-
getOpCode
public abstract int getOpCode()
-
bytes
public final byte[] bytes() throws IOException- 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
public void writeInt(int value, OutputStream to) throws IOException- Throws:
IOException
-
writeString
public void writeString(String n, OutputStream to) throws IOException
- Throws:
IOException
-
-