Code example for AtomicLong

Methods: addAndGet

0
     */ 
    public void close() { 
      // if we're being closed due to an error, we might have allocated a 
      // buffer that we need to subtract for our memory accounting. 
      if (state_ == FrameBufferState.READING_FRAME || state_ == FrameBufferState.READ_FRAME_COMPLETE) {
        readBufferBytesAllocated.addAndGet(-buffer_.array().length);
      } 
      trans_.close();
    } 
 
    /** 
     * Check if this FrameBuffer has a full frame read. 
     */ 
    public boolean isFrameFullyRead() { 
      return state_ == FrameBufferState.READ_FRAME_COMPLETE;
    } 
 
    /** 
     * After the processor has processed the invocation, whatever thread is 
     * managing invocations should call this method on this FrameBuffer so we 
     * know it's time to start trying to write again. Also, if it turns out that