@Override
 public void close() throws IOException {
   if (closed) {
     return;
   }
   if (null != writer) {
     writer.close(null);
   }
   if (null != nativeReader) {
     nativeReader.close();
   }
   closed = true;
 }