Package org.glassfish.grizzly.memory

Examples of org.glassfish.grizzly.memory.ByteBufferArray.recycle()


                for (int i = 0; i < byteBufferArray.size(); i++) {
                    taskProcessor.processTask(new ProcessTask(array[i], readHandler));
                }

                byteBufferArray.recycle();
            }
        }
        return ctx.getStopAction();
    }
View Full Code Here


                for (int i = 0; i < byteBufferArray.size(); i++) {
                    taskQueue.add(new ProcessTask(array[i], readHandler));
                }

                byteBufferArray.recycle();
            }

            TaskProcessor.processQueue(taskQueue, null);
        }
        return ctx.getStopAction();
View Full Code Here

        final int size = array.size();
       
        final int read = (int) socketChannel.read(byteBuffers, 0, size);

        array.restore();
        array.recycle();
       
        if (read > 0) {
            buffer.position(oldPos + read);
        }
       
View Full Code Here

            final int size = array.size();

            read = (int) ((DatagramChannel) connection.getChannel()).read(byteBuffers, 0, size);

            array.restore();
            array.recycle();
        } else {
            read = ((DatagramChannel) connection.getChannel()).read(
                    buffer.toByteBuffer());
        }
View Full Code Here

                    final int size = array.size();

                    written = ((DatagramChannel) connection.getChannel()).write(byteBuffers, 0, size);

                    array.restore();
                    array.recycle();
                } else {
                    written = ((DatagramChannel) connection.getChannel()).write(
                            buffer.toByteBuffer());
                }
            }
View Full Code Here

        assert !originalMessage.hasRemaining();

        if (restore) {
            originalByteBufferArray.restore();
        }
        originalByteBufferArray.recycle();
       
        if (transformationResult != null) { // transformation error case
            disposeBuffers(currentTargetBuffer, targetBuffer);
           
            return transformationResult;
View Full Code Here

                        final int remainder = inflater.getRemaining();

                        final int remaining = byteBuffer.remaining();

                        byteBufferArray.restore();
                        byteBufferArray.recycle();

                        buffer.position(
                                buffer.position() + remaining - remainder);

                        state.setDecodeStatus(DecodeStatus.TRAILER);
View Full Code Here

            } while (lastInflated > 0);

            final int remaining = byteBuffer.remaining();

            byteBufferArray.restore();
            byteBufferArray.recycle();

            buffer.position(buffer.position() + remaining);
        }

        return resultBuffer;
View Full Code Here

                crc32.update(buf, off, len);
            }
        }

        byteBufferArray.restore();
        byteBufferArray.recycle();

        buffer.position(buffer.limit());
       
        return resultBuffer;
    }
View Full Code Here

                for (int i = 0; i < byteBufferArray.size(); i++) {
                    taskQueue.add(new ProcessTask(array[i], readHandler));
                }

                byteBufferArray.recycle();
            }

            TaskProcessor.processQueue(taskQueue, null);
        }
        return ctx.getStopAction();
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.