Thread thread = new Thread() {
final PipedOutputStream os = new PipedOutputStream(is); Thread thread = new Thread("DataHandler Pipe Pump") {
        public InputStream getInputStream() throws IOException {            final DataContentHandler dch = getDataContentHandler();            if (dch == null) {                throw new UnsupportedDataTypeException(mimeType);            }            final PipedInputStream is = new PipedInputStream();            Thread thread = new Thread() {                public void run() {                    try {                        PipedOutputStream os = new PipedOutputStream(is);                        is.connect(os);                        try {                            dch.writeTo(data, mimeType, os);                        } finally {                            os.close();                        }                    } catch (IOException e) {                        // ignore, per spec - doh!                    }                }            };            thread.start();            return is;        }