Java 类io.netty.buffer.SwappedByteBuf 实例源码

项目:netty4.0.27Learn    文件:SwappedByteBufBenchmark.java   
@Setup
public void setup() {
    swappedByteBuf = new SwappedByteBuf(Unpooled.directBuffer(8));
    unsafeSwappedByteBuf = Unpooled.directBuffer(8).order(ByteOrder.LITTLE_ENDIAN);
    if (unsafeSwappedByteBuf.getClass().equals(SwappedByteBuf.class)) {
        throw new IllegalStateException("Should not use " + SwappedByteBuf.class.getSimpleName());
    }
}
项目:netty4.0.27Learn    文件:ReplayingDecoderBuffer.java   
@Override
public ByteBuf order(ByteOrder endianness) {
    if (endianness == null) {
        throw new NullPointerException("endianness");
    }
    if (endianness == order()) {
        return this;
    }

    SwappedByteBuf swapped = this.swapped;
    if (swapped == null) {
        this.swapped = swapped = new SwappedByteBuf(this);
    }
    return swapped;
}
项目:ProtocolSupportBungee    文件:ReplayingDecoderBuffer.java   
@Override
public ByteBuf order(final ByteOrder byteOrder) {
    if (byteOrder == null) {
        throw new NullPointerException("endianness");
    }
    if (byteOrder == this.order()) {
        return this;
    }
    SwappedByteBuf swapped = this.swapped;
    if (swapped == null) {
        swapped = (this.swapped = new SwappedByteBuf(this));
    }
    return swapped;
}
项目:netty4study    文件:ReplayingDecoderBuffer.java   
@Override
public ByteBuf order(ByteOrder endianness) {
    if (endianness == null) {
        throw new NullPointerException("endianness");
    }
    if (endianness == order()) {
        return this;
    }

    SwappedByteBuf swapped = this.swapped;
    if (swapped == null) {
        this.swapped = swapped = new SwappedByteBuf(this);
    }
    return swapped;
}
项目:ProtocolSupport    文件:ReplayingDecoderBuffer.java   
@Override
public ByteBuf order(final ByteOrder byteOrder) {
    if (byteOrder == null) {
        throw new NullPointerException("endianness");
    }
    if (byteOrder == this.order()) {
        return this;
    }
    SwappedByteBuf swapped = this.swapped;
    if (swapped == null) {
        swapped = (this.swapped = new SwappedByteBuf(this));
    }
    return swapped;
}
项目:netty-netty-5.0.0.Alpha1    文件:ReplayingDecoderBuffer.java   
@Override
public ByteBuf order(ByteOrder endianness) {
    if (endianness == null) {
        throw new NullPointerException("endianness");
    }
    if (endianness == order()) {
        return this;
    }

    SwappedByteBuf swapped = this.swapped;
    if (swapped == null) {
        this.swapped = swapped = new SwappedByteBuf(this);
    }
    return swapped;
}