code: @Override
      public void close() throws IOException
      {
          if (!isClosed)
          {
              flush();
              if (closeChannel)
              {
                  channel.close();
              }
              isClosed = true;
          }
      }
docs: Closes channel. Underlying channel is closed only if it was opened
  by one of the constructors.
  @throws IOException