docs: @Override
      public void close() throws IOException {
          // Notify encoder of EOF (-1).
          if (doEncode) {
              baseNCodec.encode(singleByte, 0, EOF, context);
          } else {
              baseNCodec.decode(singleByte, 0, EOF, context);
          }
          flush();
          out.close();
      }