Package org.glassfish.grizzly

Examples of org.glassfish.grizzly.Buffer.trim()


                    if (buffer == null) {
                        return Interceptor.INCOMPLETED;
                    }

                    buffer.trim();
                    append(buffer);
                    if (isDone) {
                        return Interceptor.COMPLETED;
                    }
View Full Code Here


            }
        }

        if (readResult.getReadSize() > 0) {
            final Buffer buffer = readResult.getMessage();
            buffer.trim();
            final Holder<SocketAddress> addressHolder =
                    readResult.getSrcAddressHolder();
            readResult.recycle();

            ctx.setMessage(buffer);
View Full Code Here

                LOGGER.log(Level.FINE, "SSLDecoderr done engine: {0} result: {1} input: {2} output: {3}",
                        new Object[]{sslEngine, sslEngineResult, originalMessage, targetBuffer});
            }

            if (status == SSLEngineResult.Status.OK) {
                targetBuffer.trim();

                return TransformationResult.createCompletedResult(
                        targetBuffer, originalMessage);
            } else if (status == SSLEngineResult.Status.CLOSED) {
                targetBuffer.dispose();
View Full Code Here

            if (result.isError()) {
                throw result.getError();
            }
           
            output = result.getOutput();
            output.trim();
           
            if (input.hasRemaining()) {
                do {
                    result = wrap(input, inputArray, inputArraySize,
                            null, allocator);
View Full Code Here

                    if (result.isError()) {
                        throw result.getError();
                    }
                   
                    final Buffer newOutput = result.getOutput();
                    newOutput.trim();
                   
                    output = Buffers.appendBuffers(memoryManager, output,
                            newOutput);
                } while (input.hasRemaining());
            }
View Full Code Here

                            result.getSslEngineResult().getStatus());
            }
        } while (true);
       
        if (output != null) {
            output.trim();

            if (output.hasRemaining() || isClosed) {
                ctx.setMessage(output);
                return ctx.getInvokeAction(makeInputRemainder(sslCtx, ctx, input));
            }
View Full Code Here

                            new Object[]{sslEngine, sslEngineResult, originalByteBuffer, currentTargetByteBuffer});
                }

                if (status == SSLEngineResult.Status.OK) {
                    currentTargetBuffer.position(sslEngineResult.bytesProduced());
                    currentTargetBuffer.trim();
                    targetBuffer = Buffers.appendBuffers(memoryManager,
                            targetBuffer, currentTargetBuffer);

                } else if (status == SSLEngineResult.Status.CLOSED) {
                    transformationResult =
View Full Code Here

        if (dst == null || dst.remaining() < size) {
            dst = resizeBuffer(_decoderState.getMemoryManager(), dst, size);
            _decoderState.setDst(dst);
        }
        dst.put(_buffer, _streamPos, size);
        dst.trim();
        dst.position(dst.limit());
       
        if (_pos >= _windowSize) {
            _pos = 0;
        }
View Full Code Here

                    buffer.allowBufferDispose(true);
                   
                    final long readNow = Buffers.readFromFileChannel(fc, buffer);
                    isLast = readNow <= 0 || (remaining -= readNow) <= 0;

                    buffer.trim();
                    ctx.write(HttpContent.builder(response)
                            .content(buffer)
                            .last(isLast)
                            .build());
                   
View Full Code Here

                complete(false);
                return false;
            }

            // prepare buffer to be written
            buffer.trim();

            // write the Buffer
            outputStream.write(buffer);
            size -= justReadBytes;
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.