Package io.netty.buffer

Examples of io.netty.buffer.ChannelBuffer.writeByte()


            int length = 4 + numEntries * 8;
            ChannelBuffer frame = ChannelBuffers.buffer(
                    ByteOrder.BIG_ENDIAN, SPDY_HEADER_SIZE + length);
            frame.writeShort(SPDY_VERSION | 0x8000);
            frame.writeShort(SPDY_SETTINGS_FRAME);
            frame.writeByte(flags);
            frame.writeMedium(length);
            frame.writeInt(numEntries);
            for (Integer ID: IDs) {
                int id = ID.intValue();
                byte ID_flags = (byte) 0;
View Full Code Here


                    ID_flags |= SPDY_SETTINGS_PERSISTED;
                }
                // Chromium Issue 79156
                // SPDY setting ids are not written in network byte order
                // Write id assuming the architecture is little endian
                frame.writeByte((id >>  0) & 0xFF);
                frame.writeByte((id >>  8) & 0xFF);
                frame.writeByte((id >> 16) & 0xFF);
                frame.writeByte(ID_flags);
                frame.writeInt(spdySettingsFrame.getValue(id));
            }
View Full Code Here

                }
                // Chromium Issue 79156
                // SPDY setting ids are not written in network byte order
                // Write id assuming the architecture is little endian
                frame.writeByte((id >>  0) & 0xFF);
                frame.writeByte((id >>  8) & 0xFF);
                frame.writeByte((id >> 16) & 0xFF);
                frame.writeByte(ID_flags);
                frame.writeInt(spdySettingsFrame.getValue(id));
            }
            return frame;
View Full Code Here

                // Chromium Issue 79156
                // SPDY setting ids are not written in network byte order
                // Write id assuming the architecture is little endian
                frame.writeByte((id >>  0) & 0xFF);
                frame.writeByte((id >>  8) & 0xFF);
                frame.writeByte((id >> 16) & 0xFF);
                frame.writeByte(ID_flags);
                frame.writeInt(spdySettingsFrame.getValue(id));
            }
            return frame;
View Full Code Here

                // SPDY setting ids are not written in network byte order
                // Write id assuming the architecture is little endian
                frame.writeByte((id >>  0) & 0xFF);
                frame.writeByte((id >>  8) & 0xFF);
                frame.writeByte((id >> 16) & 0xFF);
                frame.writeByte(ID_flags);
                frame.writeInt(spdySettingsFrame.getValue(id));
            }
            return frame;

        } else if (msg instanceof SpdyNoOpFrame) {
View Full Code Here

            int valueLength = 0;
            headerBlock.writeShort(valueLength);
            for (String value: headerFrame.getHeaders(name)) {
                byte[] valueBytes = value.getBytes("UTF-8");
                headerBlock.writeBytes(valueBytes);
                headerBlock.writeByte(0);
                valueLength += valueBytes.length + 1;
            }
            valueLength --;
            if (valueLength > SPDY_MAX_NV_LENGTH) {
                throw new IllegalArgumentException(
View Full Code Here

            }
            ChannelBuffer header = ChannelBuffers.dynamicBuffer(
                    channel.getConfig().getBufferFactory());
            encodeInitialLine(header, m);
            encodeHeaders(header, m);
            header.writeByte(CR);
            header.writeByte(LF);

            ChannelBuffer content = m.getContent();
            if (!content.readable()) {
                return header; // no content
View Full Code Here

            ChannelBuffer header = ChannelBuffers.dynamicBuffer(
                    channel.getConfig().getBufferFactory());
            encodeInitialLine(header, m);
            encodeHeaders(header, m);
            header.writeByte(CR);
            header.writeByte(LF);

            ChannelBuffer content = m.getContent();
            if (!content.readable()) {
                return header; // no content
            } else if (chunked) {
View Full Code Here

                if (chunk.isLast()) {
                    chunked = false;
                    if (chunk instanceof HttpChunkTrailer) {
                        ChannelBuffer trailer = ChannelBuffers.dynamicBuffer(
                                channel.getConfig().getBufferFactory());
                        trailer.writeByte((byte) '0');
                        trailer.writeByte(CR);
                        trailer.writeByte(LF);
                        encodeTrailingHeaders(trailer, (HttpChunkTrailer) chunk);
                        trailer.writeByte(CR);
                        trailer.writeByte(LF);
View Full Code Here

                    chunked = false;
                    if (chunk instanceof HttpChunkTrailer) {
                        ChannelBuffer trailer = ChannelBuffers.dynamicBuffer(
                                channel.getConfig().getBufferFactory());
                        trailer.writeByte((byte) '0');
                        trailer.writeByte(CR);
                        trailer.writeByte(LF);
                        encodeTrailingHeaders(trailer, (HttpChunkTrailer) chunk);
                        trailer.writeByte(CR);
                        trailer.writeByte(LF);
                        return trailer;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.