BufferImpl(ByteBuf buffer) { this.buffer = Unpooled.unreleasableBuffer(buffer); }
/** * Creates a new frame with the specified frame type and the specified data. * * @param type the type of the frame. {@code 0} is the only allowed type currently. * @param binaryData the content of the frame. If <tt>(type & 0x80 == 0)</tt>, * it must be encoded in UTF-8. * @param isFinalFrame If this is the final frame in a sequence * @throws IllegalArgumentException if If <tt>(type & 0x80 == 0)</tt> and the data is not encoded * in UTF-8 */ public WebSocketFrameImpl(FrameType type, ByteBuf binaryData, boolean isFinalFrame) { this.type = type; this.isFinalFrame = isFinalFrame; this.binaryData = Unpooled.unreleasableBuffer(binaryData); }
public ChannelBufferWrapper(final ByteBuf buffer, boolean releasable, boolean pooled) { if (!releasable) { this.buffer = Unpooled.unreleasableBuffer(buffer); } else { this.buffer = buffer; } this.releasable = releasable; this.isPooled = pooled; }
BufferImpl(int initialSizeHint) { buffer = Unpooled.unreleasableBuffer(Unpooled.buffer(initialSizeHint, Integer.MAX_VALUE)); }
BufferImpl(byte[] bytes) { buffer = Unpooled.unreleasableBuffer(Unpooled.buffer(bytes.length, Integer.MAX_VALUE)).writeBytes(bytes); }
public void server(int port) throws Exception { final ByteBuf buf = Unpooled.unreleasableBuffer(Unpooled.copiedBuffer("Hi!\r\n", Charset.forName("UTF-8"))); NioEventLoopGroup group = new NioEventLoopGroup();
public void server(int port) throws Exception { final ByteBuf buf = Unpooled.unreleasableBuffer(Unpooled.copiedBuffer("Hi!\r\n", Charset.forName("UTF-8"))); EventLoopGroup group = new OioEventLoopGroup(); try {
for (String message : DEFAULT_SIMPLE_STRINGS) { ByteBuf key = Unpooled.unmodifiableBuffer( Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(message.getBytes(CharsetUtil.UTF_8)))); SimpleStringRedisMessage cached = new SimpleStringRedisMessage(message); byteBufToSimpleStrings.put(key, cached); for (String message : DEFAULT_ERRORS) { ByteBuf key = Unpooled.unmodifiableBuffer( Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(message.getBytes(CharsetUtil.UTF_8)))); ErrorRedisMessage cached = new ErrorRedisMessage(message); byteBufToErrors.put(key, cached); for (long value = MIN_CACHED_INTEGER_NUMBER; value < MAX_CACHED_INTEGER_NUMBER; value++) { byte[] keyBytes = RedisCodecUtil.longToAsciiBytes(value); ByteBuf keyByteBuf = Unpooled.unmodifiableBuffer(Unpooled.unreleasableBuffer( Unpooled.wrappedBuffer(keyBytes))); IntegerRedisMessage cached = new IntegerRedisMessage(value);
BufferImpl(ByteBuf buffer) { this.buffer = Unpooled.unreleasableBuffer(buffer); }
/** * Creates a new frame with the specified frame type and the specified data. * * @param type the type of the frame. {@code 0} is the only allowed type currently. * @param binaryData the content of the frame. If <tt>(type & 0x80 == 0)</tt>, * it must be encoded in UTF-8. * @param isFinalFrame If this is the final frame in a sequence * @throws IllegalArgumentException if If <tt>(type & 0x80 == 0)</tt> and the data is not encoded * in UTF-8 */ public WebSocketFrameImpl(FrameType type, ByteBuf binaryData, boolean isFinalFrame) { this.type = type; this.isFinalFrame = isFinalFrame; this.binaryData = Unpooled.unreleasableBuffer(binaryData); }
BufferImpl(int initialSizeHint) { buffer = Unpooled.unreleasableBuffer(Unpooled.buffer(initialSizeHint, Integer.MAX_VALUE)); }
BufferImpl(int initialSizeHint) { buffer = Unpooled.unreleasableBuffer(Unpooled.buffer(initialSizeHint, Integer.MAX_VALUE)); }
private final ByteBuf PLAINTEXT_CONTENT_BUFFER = Unpooled.unreleasableBuffer(Unpooled.directBuffer().writeBytes(STATIC_PLAINTEXT)); private final CharSequence PLAINTEXT_CLHEADER_VALUE = new AsciiString(String.valueOf(STATIC_PLAINTEXT_LEN)); nettyChannel.config().setAllocator(new Alloc()); GET = Unpooled.unreleasableBuffer(Unpooled.copiedBuffer(( "GET / HTTP/1.1\r\n" + "\r\n").getBytes()));
BufferImpl(byte[] bytes) { buffer = Unpooled.unreleasableBuffer(Unpooled.buffer(bytes.length, Integer.MAX_VALUE)).writeBytes(bytes); }
BufferImpl(byte[] bytes) { buffer = Unpooled.unreleasableBuffer(Unpooled.buffer(bytes.length, Integer.MAX_VALUE)).writeBytes(bytes); }
public ChannelBufferWrapper(final ByteBuf buffer, boolean releasable, boolean pooled) { if (!releasable) { this.buffer = Unpooled.unreleasableBuffer(buffer); } else { this.buffer = buffer; } this.releasable = releasable; this.isPooled = pooled; }
public ChannelBufferWrapper(final ByteBuf buffer, boolean releasable, boolean pooled) { if (!releasable) { this.buffer = Unpooled.unreleasableBuffer(buffer); } else { this.buffer = buffer; } this.releasable = releasable; this.isPooled = pooled; }
public ChannelBufferWrapper(final ByteBuf buffer, boolean releasable, boolean pooled) { if (!releasable) { this.buffer = Unpooled.unreleasableBuffer(buffer); } else { this.buffer = buffer; } this.releasable = releasable; this.isPooled = pooled; }
public ChannelBufferWrapper(final ByteBuf buffer, boolean releasable) { if (!releasable) { this.buffer = Unpooled.unreleasableBuffer(buffer); } else { this.buffer = buffer; } this.releasable = releasable; }
private final ByteBuf PLAINTEXT_CONTENT_BUFFER = Unpooled.unreleasableBuffer(Unpooled.directBuffer().writeBytes(STATIC_PLAINTEXT)); private final CharSequence PLAINTEXT_CLHEADER_VALUE = new AsciiString(String.valueOf(STATIC_PLAINTEXT_LEN)); nettyChannel.config().setAllocator(new Alloc()); GET = Unpooled.unreleasableBuffer(Unpooled.copiedBuffer(( "GET / HTTP/1.1\r\n" + "\r\n").getBytes()));