Package net.gleamynode.netty.array

Examples of net.gleamynode.netty.array.HeapByteArray


                            pendingUnencryptedWrites.remove();
                        }
                    }
                    if (result.bytesProduced() > 0) {
                        outNetBuf.flip();
                        msg = new HeapByteArray(outNetBuf.remaining());
                        msg.set(msg.firstIndex(), outNetBuf.array(), 0, msg.length());
                        outNetBuf.clear();

                        if (pendingWrite.outAppBuf.hasRemaining()) {
                            // pendingWrite's future shouldn't be notified if
View Full Code Here


            for (;;) {
                result = engine.wrap(EMPTY_BUFFER, outNetBuf);

                if (result.bytesProduced() > 0) {
                    outNetBuf.flip();
                    ByteArray msg = new HeapByteArray(outNetBuf.remaining());
                    msg.set(msg.firstIndex(), outNetBuf.array(), 0, msg.length());
                    outNetBuf.clear();
                    if (channel.isConnected()) {
                        future = new DefaultChannelFuture(channel, false);
                        ChannelUtil.write(ctx, channel, future, msg);
                    }
View Full Code Here

            }

            outAppBuf.flip();

            if (outAppBuf.hasRemaining()) {
                ByteArray frame = new HeapByteArray(outAppBuf.remaining());
                frame.set(frame.firstIndex(), outAppBuf.array(), 0, frame.length());
                return frame;
            } else {
                return null;
            }
        } catch (SSLException e) {
View Full Code Here

            predictor.previousReceiveBufferSize(readBytes);

            // Fire the event.
            ByteArray array;
            if (readBytes == buf.capacity()) {
                array = new HeapByteArray(buf.array());
            } else {
                array = new StaticPartialByteArray(buf.array(), 0, readBytes);
            }
            fireMessageReceived(channel, array);
        }
View Full Code Here

                break;
            }

            ByteArray array;
            if (readBytes == buf.length) {
                array = new HeapByteArray(buf);
            } else {
                array = new StaticPartialByteArray(buf, 0, readBytes);
            }
            fireMessageReceived(channel, array);
        }
View Full Code Here

        } else if (index < super.firstIndex() || dstIndex + length > dst.endIndex()) {
            throw new NoSuchElementException();
        } else if (index + length > super.endIndex()) {
            rewind();
        } else {
            ByteArray src = new HeapByteArray(length);
            super.get(index, src, 0, length);
            src.get(0, dst, dstIndex, length);
            record(src);
        }
    }
View Full Code Here

        } else if (index < super.firstIndex()) {
            throw new NoSuchElementException();
        } else if (index + dst.remaining() > super.endIndex()) {
            rewind();
        } else {
            ByteArray src = new HeapByteArray(dst.remaining());
            super.get(index, src, 0, dst.remaining());
            src.get(0, dst);
            record(src);
        }
    }
View Full Code Here

            return;
        }

        String src = (String) e.getMessage();
        ChannelUtil.write(
                context, e.getChannel(), e.getFuture(), new HeapByteArray(src.getBytes(charsetName)));
    }
View Full Code Here

        msg[1] = (byte) (bodyLen >>> 16);
        msg[2] = (byte) (bodyLen >>>  8);
        msg[3] = (byte) (bodyLen >>>  0);

        ChannelUtil.write(
                context, e.getChannel(), e.getFuture(), new HeapByteArray(msg));
    }
View Full Code Here

*/
public class Delimiters {

    public static ByteArray[] newNulDelimiter() {
        return new ByteArray[] {
                new HeapByteArray(new byte[] { 0 }) };
    }
View Full Code Here

TOP

Related Classes of net.gleamynode.netty.array.HeapByteArray

Copyright © 2018 www.massapicom. 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.