Package java.io

Examples of java.io.BufferedOutputStream


            File tempDir = createTempDirectory("teiid-deploy-content", null, getServerTempDirectory());

            //The userSpecifiedName is used in case we renamed the file to add version.
            File contentCopy = new File(tempDir, userSpecifedName);

            os = new BufferedOutputStream(new FileOutputStream(contentCopy));
            ContentContext contentContext = resourceContext.getContentContext();
            ContentServices contentServices = contentContext.getContentServices();
            contentServices.downloadPackageBitsForChildResource(contentContext, resourceType.getName(), key, os);

            return contentCopy;
View Full Code Here


         
          if (stream == null) {
            store = storageManager.createFileStore("temp-stream"); //$NON-NLS-1$
            StreamFactoryReference sfr = streams.get(streamIndex);
            sfr.setStreamFactory(new FileStoreInputStreamFactory(store, Streamable.ENCODING));
            this.stream = new BufferedOutputStream(store.createOutputStream());
          }
          if (dataLen == 0) {
            stream.close();
            stream = null;
            streamIndex++;
View Full Code Here

      tf.setOutputProperty(OutputKeys.METHOD, "xml");//$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.STANDALONE, "yes");//$NON-NLS-1$
      tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); //$NON-NLS-1$ //$NON-NLS-2$
     
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      StreamResult xmlOut = new StreamResult(new BufferedOutputStream(out));
      tf.transform(xml.getSource(StreamSource.class), xmlOut);
     
      return out.toString();
    } catch (Exception e) {
      return xml.getString();
View Full Code Here

          manifest.delete();
        }
        transformConfig(config, "/vdb.xsl", new StreamResult(new File(metainf, "vdb.xml")));
        config.delete();
        FileOutputStream out = new FileOutputStream(new File(file.getParent(), fileName + "_70.vdb"));
        ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(out));
        int parentLength = dir.getPath().length();
        addDirectory(dir, zos, parentLength);
        zos.close();
      } finally {
        FileUtils.removeDirectoryAndChildren(dir);
View Full Code Here

    String filename = url2Filename(doc.getURL());
    if (doc.getContent().length >= minFileSize) {
      try {
    createDirs(filename);
    BufferedOutputStream os =
      new BufferedOutputStream(new FileOutputStream(filename));
    os.write(doc.getContent());
    os.flush();
    os.close();
      } catch (IOException e) {
    throw new DocManagerException(e.getMessage());
      }
    }
  }
View Full Code Here

      }
      int returnVal = m_FileChooser.showSaveDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
  File sFile = m_FileChooser.getSelectedFile();
  try {
    ObjectOutputStream oo = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFile)));
    oo.writeObject(object);
    oo.close();
  } catch (Exception ex) {
    JOptionPane.showMessageDialog(this,
          "Couldn't write to file: "
View Full Code Here

        objectOutputStream.flush();
        objectOutputStream.close();
      }
      // KOML/XML
      else {
        BufferedOutputStream xmlOutputStream = new BufferedOutputStream(os);
        if (objectOutputFileName.endsWith(".xml")) {
          XMLSerialization xmlSerial = new XMLClassifier();
          xmlSerial.write(xmlOutputStream, classifier);
        }
        else
          // whether KOML is present has already been checked
          // if not present -> ".koml" is interpreted as binary - see above
          if (objectOutputFileName.endsWith(".koml")) {
            KOML.write(xmlOutputStream, classifier);
          }
        xmlOutputStream.close();
      }
    }

    // If classifier is drawable output string describing graph
    if ((classifier instanceof Drawable) && (printGraph)){
View Full Code Here

        // temp. filename
        tempFile = File.createTempFile("arffviewer", null);
        tempFile.deleteOnExit();
       
        // serialize instances
        oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(tempFile)));
        oos.writeObject(getInstances());
        oos.flush();
        oos.close();
       
        // add to undo list
View Full Code Here

//        System.out.println("Cache: inflating " + ze.getName());
        if (ze.isDirectory()) {
          new File(cacheDir, ze.getName()).mkdir();
          continue;
        }
        BufferedOutputStream bo =
          new BufferedOutputStream(new FileOutputStream(new File(cacheDir, ze.getName())));
        while (true) {
          int amountRead = zis.read(buff);
          if (amountRead == -1) {
            break;
          }
          // write the data here
          bo.write(buff, 0, amountRead);
        }
        bo.close();
      }
    } catch (Exception e) {
      e.printStackTrace();
     
      // OK, we have a problem with the repository cache - use
View Full Code Here

      File tempFile = File.createTempFile("weka", SerializedInstancesLoader.FILE_EXTENSION);
      tempFile.deleteOnExit();

      ObjectOutputStream oos =
  new ObjectOutputStream(
  new BufferedOutputStream(
  new FileOutputStream(tempFile)));
   
      oos.writeObject(m_Instances);
      oos.flush();
      oos.close();
View Full Code Here

TOP

Related Classes of java.io.BufferedOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.