if (!mWriteManager.isWritePending()) { closeChannel(CloseReason.NORMAL);
if (!isWritePending()) { teardown(TeardownReason.NORMAL);
        public void close() throws IOException {            synchronized (mLock) {                mCloseAfterWrite = true;                if (!mWriteManager.isWritePending()) {                    closeChannel(CloseReason.NORMAL);                }            }        }