Examples of firstIndex()


Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

                        }
                    }
                    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
                            // only partial data is written.
View Full Code Here

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

                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

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

            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

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

                try {
                    for (int i = channel.getConfig().getWriteSpinCount(); i > 0; i --) {
                        localWrittenBytes = a.copyTo(
                            channel.socket,
                            channel.currentWriteIndex,
                            Math.min(maxWrittenBytes - writtenBytes, a.length() - (channel.currentWriteIndex - a.firstIndex())));
                        if (localWrittenBytes != 0) {
                            break;
                        }
                    }
                } catch (Throwable t) {
View Full Code Here

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

            return;
        }

        ByteArray src = (ByteArray) e.getMessage();
        byte[] dst = new byte[src.length()];
        src.get(src.firstIndex(), dst);
        ChannelUtil.fireMessageReceived(context, e.getChannel(), new String(dst, charsetName));
    }
}
View Full Code Here

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

                try {
                    for (int i = channel.getConfig().getWriteSpinCount(); i > 0; i --) {
                        localWrittenBytes = a.copyTo(
                            channel.socket,
                            channel.currentWriteIndex,
                            Math.min(maxWrittenBytes - writtenBytes, a.length() - (channel.currentWriteIndex - a.firstIndex())));
                        if (localWrittenBytes != 0) {
                            break;
                        }
                    }
                } catch (Throwable t) {
View Full Code Here

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

            return;
        }

        ByteArray src = (ByteArray) e.getMessage();
        byte[] dst = new byte[src.length()];
        src.get(src.firstIndex(), dst);
        ChannelUpstream.fireMessageReceived(context, e.getChannel(), new String(dst, charsetName));
    }
}
View Full Code Here

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

                        }
                    }
                    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
                            // only partial data is written.
View Full Code Here

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

                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);
                        ChannelDownstream.write(ctx, channel, future, msg);
                    }
View Full Code Here

Examples of net.gleamynode.netty.array.ByteArray.firstIndex()

            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
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.