当前位置: 首页>>代码示例>>Java>>正文


Java MessageInput类代码示例

本文整理汇总了Java中com.sedmelluq.discord.lavaplayer.tools.io.MessageInput的典型用法代码示例。如果您正苦于以下问题:Java MessageInput类的具体用法?Java MessageInput怎么用?Java MessageInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageInput类属于com.sedmelluq.discord.lavaplayer.tools.io包,在下文中一共展示了MessageInput类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decodeTrack

import com.sedmelluq.discord.lavaplayer.tools.io.MessageInput; //导入依赖的package包/类
@Override
public DecodedTrackHolder decodeTrack(MessageInput stream) throws IOException {
  DataInput input = stream.nextMessage();
  if (input == null) {
    return null;
  }

  int version = (stream.getMessageFlags() & TRACK_INFO_VERSIONED) != 0 ? (input.readByte() & 0xFF) : 1;

  AudioTrackInfo trackInfo = new AudioTrackInfo(input.readUTF(), input.readUTF(), input.readLong(), input.readUTF(),
      input.readBoolean(), version >= 2 ? DataFormatTools.readNullableText(input) : null);
  AudioTrack track = decodeTrackDetails(trackInfo, input);
  long position = input.readLong();

  if (track != null) {
    track.setPosition(position);
  }

  stream.skipRemainingBytes();

  return new DecodedTrackHolder(track);
}
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:23,代码来源:DefaultAudioPlayerManager.java

示例2: deserialize

import com.sedmelluq.discord.lavaplayer.tools.io.MessageInput; //导入依赖的package包/类
@BotCommandHandler
private void deserialize(Message message, String content) throws IOException {
  outputChannel.set((TextChannel) message.getChannel());
  connectToFirstVoiceChannel(guild.getAudioManager());

  byte[] bytes = Base64.decode(content);

  MessageInput inputStream = new MessageInput(new ByteArrayInputStream(bytes));
  DecodedTrackHolder holder;

  while ((holder = manager.decodeTrack(inputStream)) != null) {
    if (holder.decodedTrack != null) {
      scheduler.addToQueue(holder.decodedTrack);
    }
  }
}
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:17,代码来源:MusicController.java

示例3: toAudioTrack

import com.sedmelluq.discord.lavaplayer.tools.io.MessageInput; //导入依赖的package包/类
public static AudioTrack toAudioTrack(String message) throws IOException {
    byte[] b64 = Base64.decodeBase64(message);
    ByteArrayInputStream bais = new ByteArrayInputStream(b64);
    return Player.PLAYER_MANAGER.decodeTrack(new MessageInput(bais)).decodedTrack;
}
 
开发者ID:Frederikam,项目名称:Lavalink,代码行数:6,代码来源:Util.java

示例4: toAudioTrack

import com.sedmelluq.discord.lavaplayer.tools.io.MessageInput; //导入依赖的package包/类
public static AudioTrack toAudioTrack(String message) throws IOException {
    byte[] b64 = Base64.decode(message);
    ByteArrayInputStream bais = new ByteArrayInputStream(b64);
    return PLAYER_MANAGER.decodeTrack(new MessageInput(bais)).decodedTrack;
}
 
开发者ID:Frederikam,项目名称:Lavalink,代码行数:6,代码来源:LavalinkUtil.java

示例5: decodeTrack

import com.sedmelluq.discord.lavaplayer.tools.io.MessageInput; //导入依赖的package包/类
/**
 * Decode a track from an input stream. Null returns value indicates reaching the position where the decoder had
 * called MessageOutput#finish().
 *
 * @param stream The message stream to read it from.
 * @return Holder containing the track if it was successfully decoded.
 * @throws IOException On IO error.
 */
DecodedTrackHolder decodeTrack(MessageInput stream) throws IOException;
 
开发者ID:sedmelluq,项目名称:lavaplayer,代码行数:10,代码来源:AudioPlayerManager.java


注:本文中的com.sedmelluq.discord.lavaplayer.tools.io.MessageInput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。