Package in.dragonbra.javasteam.base
Class AbstractMsgBase
- java.lang.Object
-
- in.dragonbra.javasteam.base.AbstractMsgBase
-
-
Field Summary
Fields Modifier and Type Field Description protected MemoryStreampayload
-
Constructor Summary
Constructors Constructor Description AbstractMsgBase()Initializes a new instance of theAbstractMsgBaseclass.AbstractMsgBase(int payloadReserve)Initializes a new instance of theAbstractMsgBaseclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MemoryStreamgetPayload()bytereadByte()byte[]readBytes(int numBytes)doublereadDouble()floatreadFloat()intreadInt()longreadLong()java.lang.StringreadNullTermString()java.lang.StringreadNullTermString(java.nio.charset.Charset charset)shortreadShort()longseek(long offset, SeekOrigin seekOrigin)Seeks within the payload to the specified offset.voidwrite(byte data)voidwrite(byte[] data)voidwrite(double data)voidwrite(float data)voidwrite(int data)voidwrite(long data)voidwrite(short data)voidwrite(java.lang.String data)voidwrite(java.lang.String data, java.nio.charset.Charset charset)voidwriteNullTermString(java.lang.String data)voidwriteNullTermString(java.lang.String data, java.nio.charset.Charset charset)
-
-
-
Field Detail
-
payload
protected MemoryStream payload
-
-
Constructor Detail
-
AbstractMsgBase
public AbstractMsgBase()
Initializes a new instance of theAbstractMsgBaseclass.
-
AbstractMsgBase
public AbstractMsgBase(int payloadReserve)
Initializes a new instance of theAbstractMsgBaseclass.- Parameters:
payloadReserve- The number of bytes to initialize the payload capacity to.
-
-
Method Detail
-
seek
public long seek(long offset, SeekOrigin seekOrigin)Seeks within the payload to the specified offset.- Parameters:
offset- The offset in the payload to seek to.seekOrigin- The origin to seek from.- Returns:
- The new position within the stream, calculated by combining the initial reference point and the offset.
-
write
public void write(byte data) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(short data) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(int data) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(long data) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(byte[] data) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(float data) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(double data) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(java.lang.String data) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(java.lang.String data, java.nio.charset.Charset charset) throws java.io.IOException- Throws:
java.io.IOException
-
writeNullTermString
public void writeNullTermString(java.lang.String data) throws java.io.IOException- Throws:
java.io.IOException
-
writeNullTermString
public void writeNullTermString(java.lang.String data, java.nio.charset.Charset charset) throws java.io.IOException- Throws:
java.io.IOException
-
readByte
public byte readByte() throws java.io.IOException- Throws:
java.io.IOException
-
readBytes
public byte[] readBytes(int numBytes) throws java.io.IOException- Throws:
java.io.IOException
-
readShort
public short readShort() throws java.io.IOException- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException- Throws:
java.io.IOException
-
readDouble
public double readDouble() throws java.io.IOException- Throws:
java.io.IOException
-
readNullTermString
public java.lang.String readNullTermString() throws java.io.IOException- Throws:
java.io.IOException
-
readNullTermString
public java.lang.String readNullTermString(java.nio.charset.Charset charset) throws java.io.IOException- Throws:
java.io.IOException
-
getPayload
public MemoryStream getPayload()
-
-