Class ProxyPayload
java.lang.Object
net.flectone.pulse.util.payload.ProxyPayload
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Constructor Details
-
ProxyPayload
public ProxyPayload(byte[] bytes) Opens a payload for reading.- Parameters:
bytes- the raw payload
-
-
Method Details
-
readString
Reads a string.- Returns:
- the value
- Throws:
IOException- if the payload ends early
-
readInt
Reads an int.- Returns:
- the value
- Throws:
IOException- if the payload ends early
-
readLong
Reads a long.- Returns:
- the value
- Throws:
IOException- if the payload ends early
-
readBoolean
Reads a boolean.- Returns:
- the value
- Throws:
IOException- if the payload ends early
-
readUUID
Reads a uuid.- Returns:
- the value
- Throws:
IOException- if the payload ends early
-
readAllBytes
Reads whatever is left of the payload.- Returns:
- the remaining bytes
- Throws:
IOException- if reading fails
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-