Class MessageInput
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.tools.io.MessageInput
-
public class MessageInput extends java.lang.ObjectAn input for messages with their size known so unknown messages can be skipped.
-
-
Constructor Summary
Constructors Constructor Description MessageInput(java.io.InputStream inputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMessageFlags()java.io.DataInputnextMessage()voidskipRemainingBytes()Skip the remaining bytes of the last message returned from nextMessage().
-
-
-
Method Detail
-
nextMessage
public java.io.DataInput nextMessage() throws java.io.IOException- Returns:
- Data input for the next message. Note that it does not automatically skip over the last message if it was not fully read, for that purpose, skipRemainingBytes() should be explicitly called after reading every message. A null return value indicates the position where MessageOutput#finish() had written the end marker.
- Throws:
java.io.IOException- On IO error
-
getMessageFlags
public int getMessageFlags()
- Returns:
- Flags (values 0-3) of the last message for which nextMessage() was called.
-
skipRemainingBytes
public void skipRemainingBytes() throws java.io.IOExceptionSkip the remaining bytes of the last message returned from nextMessage(). This must be called if it is not certain that all of the bytes of the message were consumed.- Throws:
java.io.IOException- On IO error
-
-