本文整理匯總了Java中com.sedmelluq.discord.lavaplayer.tools.io.MessageOutput類的典型用法代碼示例。如果您正苦於以下問題:Java MessageOutput類的具體用法?Java MessageOutput怎麽用?Java MessageOutput使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MessageOutput類屬於com.sedmelluq.discord.lavaplayer.tools.io包,在下文中一共展示了MessageOutput類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: encodeTrack
import com.sedmelluq.discord.lavaplayer.tools.io.MessageOutput; //導入依賴的package包/類
@Override
public void encodeTrack(MessageOutput stream, AudioTrack track) throws IOException {
DataOutput output = stream.startMessage();
output.write(TRACK_INFO_VERSION);
AudioTrackInfo trackInfo = track.getInfo();
output.writeUTF(trackInfo.title);
output.writeUTF(trackInfo.author);
output.writeLong(trackInfo.length);
output.writeUTF(trackInfo.identifier);
output.writeBoolean(trackInfo.isStream);
DataFormatTools.writeNullableText(output, trackInfo.uri);
encodeTrackDetails(track, output);
output.writeLong(track.getPosition());
stream.commitMessage(TRACK_INFO_VERSIONED);
}
示例2: SerializedTrack
import com.sedmelluq.discord.lavaplayer.tools.io.MessageOutput; //導入依賴的package包/類
public SerializedTrack(Track track) {
this.dj = track.dj;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
MessageOutput mo = new MessageOutput(baos);
try {
GabrielBot.getInstance().playerManager.encodeTrack(mo, track.track.makeClone());
} catch(IOException e) {
throw new AssertionError(e);
}
this.track = baos.toByteArray();
}
示例3: serialize
import com.sedmelluq.discord.lavaplayer.tools.io.MessageOutput; //導入依賴的package包/類
@BotCommandHandler
private void serialize(Message message) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
MessageOutput outputStream = new MessageOutput(baos);
for (AudioTrack track : scheduler.drainQueue()) {
manager.encodeTrack(outputStream, track);
}
outputStream.finish();
message.getChannel().sendMessage(Base64.encodeBytes(baos.toByteArray())).queue();
}
示例4: toMessage
import com.sedmelluq.discord.lavaplayer.tools.io.MessageOutput; //導入依賴的package包/類
public static String toMessage(AudioTrack track) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Player.PLAYER_MANAGER.encodeTrack(new MessageOutput(baos), track);
return Base64.encodeBase64String(baos.toByteArray());
}
示例5: toMessage
import com.sedmelluq.discord.lavaplayer.tools.io.MessageOutput; //導入依賴的package包/類
public static String toMessage(AudioTrack track) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PLAYER_MANAGER.encodeTrack(new MessageOutput(baos), track);
return new String(Base64.encodeBytesToBytes(baos.toByteArray()));
}
示例6: encodeTrack
import com.sedmelluq.discord.lavaplayer.tools.io.MessageOutput; //導入依賴的package包/類
/**
* Encode a track into an output stream. If the decoder is not supposed to know the number of tracks in advance, then
* the encoder should call MessageOutput#finish() after all the tracks it wanted to write have been written. This will
* make decodeTrack() return null at that position
*
* @param stream The message stream to write it to.
* @param track The track to encode.
* @throws IOException On IO error.
*/
void encodeTrack(MessageOutput stream, AudioTrack track) throws IOException;