public void close() {
        try {
            if (read != null)
                read.close();
            if (write != null)
                write.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }