当前位置: 首页>>代码示例>>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;未经允许,请勿转载。