Package org.apache.mina.common

Examples of org.apache.mina.common.ByteBuffer.release()


                zStream.next_out_index = 0;
                zStream.avail_out = outBytes.length;
                break;
            default:
                // unknown error
                outBuffer.release();
                outBuffer = null;
                if( zStream.msg == null )
                    throw new IOException( "Unknown error. Error code : " + retval );
                else
                    throw new IOException( "Unknown error. Error code : " + retval
View Full Code Here


            {
                disposeDecoder( session );
            }

            // Release the read buffer.
            in.release();

            decoderOut.flush();
        }
    }
View Full Code Here

            session.getFilterChain().fireExceptionCaught( session, e );
        }
        finally
        {
            if( buf != null )
                buf.release();
        }
    }

    private void notifyIdleness()
    {
View Full Code Here

                else
                {
                    data.put(payload.array(), payload.arrayOffset(), payload.limit());
                }

                payload.release();
            }

            data.flip();
        }
        else // bodies == null
View Full Code Here

    private void removeSessionBuffer(IoSession session)
    {
        ByteBuffer buf = ( ByteBuffer ) session.getAttribute( BUFFER );
        if( buf != null )
        {
            buf.release();
            session.removeAttribute( BUFFER );
        }
    }

    private static final SimpleByteBufferAllocator SIMPLE_BYTE_BUFFER_ALLOCATOR = new SimpleByteBufferAllocator();
View Full Code Here

            }
            finally
            {
                if (buf != null)
                {
                    buf.release();
                }
            }
        }//for

        // if (_loggerWrite.isDebugEnabled())
View Full Code Here

        putDataInBuffer(buffer);

        final byte[] result = new byte[encodedSize];
        buffer.flip();
        buffer.get(result);
        buffer.release();

        return result;
    }

    public long getEncodedSize()
View Full Code Here

    }

    private void removeSessionBuffer(IoSession session) {
        ByteBuffer buf = (ByteBuffer) session.removeAttribute(BUFFER);
        if (buf != null) {
            buf.release();
        }
    }

    private void storeRemainingInSession(ByteBuffer buf, IoSession session) {
        ByteBuffer remainingBuf = ByteBuffer.allocate(buf.capacity());
View Full Code Here

            if (e instanceof IOException)
                scheduleRemove(session);
            session.getFilterChain().fireExceptionCaught(session, e);
        } finally {
            if (buf != null)
                buf.release();
        }
    }

    private void notifyIdleness() {
        // process idle sessions
View Full Code Here

        WriteRequest req;

        if ((req = writeRequestQueue.poll()) != null) {
            ByteBuffer buf = (ByteBuffer) req.getMessage();
            try {
                buf.release();
            } catch (IllegalStateException e) {
                session.getFilterChain().fireExceptionCaught(session, e);
            } finally {
                // The first unwritten empty buffer must be
                // forwarded to the filter chain.
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.