當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageOutput類代碼示例

本文整理匯總了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);
}
 
開發者ID:sedmelluq,項目名稱:lavaplayer,代碼行數:19,代碼來源:DefaultAudioPlayerManager.java

示例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();
}
 
開發者ID:natanbc,項目名稱:GabrielBot,代碼行數:12,代碼來源:SerializedTrack.java

示例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();
}
 
開發者ID:sedmelluq,項目名稱:lavaplayer,代碼行數:14,代碼來源:MusicController.java

示例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());
}
 
開發者ID:Frederikam,項目名稱:Lavalink,代碼行數:6,代碼來源:Util.java

示例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()));
}
 
開發者ID:Frederikam,項目名稱:Lavalink,代碼行數:6,代碼來源:LavalinkUtil.java

示例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;
 
開發者ID:sedmelluq,項目名稱:lavaplayer,代碼行數:11,代碼來源:AudioPlayerManager.java


注:本文中的com.sedmelluq.discord.lavaplayer.tools.io.MessageOutput類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。