FloatSampleSource.java

net.minecraft.client.sounds.FloatSampleSource

信息

  • 全限定名:net.minecraft.client.sounds.FloatSampleSource
  • 类型:public interface
  • 包:net.minecraft.client.sounds
  • 源码路径:src/main/java/net/minecraft/client/sounds/FloatSampleSource.java
  • 起始行号:L10
  • 继承:FiniteAudioStream
  • 职责:

    TODO

字段/常量

  • EXPECTED_MAX_FRAME_SIZE
    • 类型: int
    • 修饰符: package-private
    • 源码定位: L11
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

boolean readChunk(FloatConsumer output) @ L13

  • 方法名:readChunk
  • 源码定位:L13
  • 返回类型:boolean
  • 修饰符:package-private

参数:

  • output: FloatConsumer

说明:

TODO

default ByteBuffer read(int expectedSize) @ L15

  • 方法名:read
  • 源码定位:L15
  • 返回类型:ByteBuffer
  • 修饰符:default

参数:

  • expectedSize: int

说明:

TODO

default ByteBuffer readAll() @ L25

  • 方法名:readAll
  • 源码定位:L25
  • 返回类型:ByteBuffer
  • 修饰符:default

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public interface FloatSampleSource extends FiniteAudioStream {
    int EXPECTED_MAX_FRAME_SIZE = 8192;
 
    boolean readChunk(FloatConsumer output) throws IOException;
 
    @Override
    default ByteBuffer read(int expectedSize) throws IOException {
        ChunkedSampleByteBuf output = new ChunkedSampleByteBuf(expectedSize + 8192);
 
        while (this.readChunk(output) && output.size() < expectedSize) {
        }
 
        return output.get();
    }
 
    @Override
    default ByteBuffer readAll() throws IOException {
        ChunkedSampleByteBuf output = new ChunkedSampleByteBuf(16384);
 
        while (this.readChunk(output)) {
        }
 
        return output.get();
    }
}

引用的其他类