Package java.io

Examples of java.io.ByteArrayInputStream


            // convert to byte array
            byte[] result1 = out.toByteArray();
   
            // put this
            String filename = generateRandomFilename();
            ftp.put(new ByteArrayInputStream(result1), filename);
   
            // get it back
            byte[] result2 = ftp.get(filename);
   
            // delete remote file
View Full Code Here


    }

    void button1_action(ActionEvent evt) {
        String expr = textArea1.getText();
        XQueryParser parser = new XQueryParser(
                new ByteArrayInputStream(expr.getBytes()));
        parser.disable_tracing();

        PrintVisitor dumper;
        try {
            XQueryModule module = parser.parse();
View Full Code Here

        FTPTransferType currentTransferType = chooseTransferMode(remoteFile);
       
        String result = null;      
        try {

            ByteArrayInputStream input = null;
            if (retryCount == 0 || append) {
                input = new ByteArrayInputStream(bytes);
                result = putStream(input, remoteFile, append);
            } else {
                for (int attempt = 1;; attempt++) {
                    try {
                        if (attempt > 1
                                && getType().equals(FTPTransferType.BINARY))
                            resume();
                        log.debug("Attempt #" + attempt);
                        input = new ByteArrayInputStream(bytes);
                        result = putStream(input, remoteFile, append);
                        break;
                    } catch (ControlChannelIOException ex) {
                        if (!processControlChannelException(cwd, ex, attempt))
                            throw ex;
View Full Code Here

        return put(bytes, remoteFile, false);
    }

    public String put(byte[] bytes, String remoteFile, boolean append)
            throws IOException, FTPException {
        ByteArrayInputStream str = new ByteArrayInputStream(bytes);
        return put(str, remoteFile, append);
    }
View Full Code Here

                }
   
                if (arg instanceof InputStream) {
                    in = (InputStream) arg;
                } else if (arg instanceof byte[]) {
                    in = new ByteArrayInputStream((byte[]) arg);
                } else if (arg instanceof MimePart) {
                    in = new ByteArrayInputStream(((MimePart) arg).getContent());
                } else if (arg instanceof File) {
                    in = new FileInputStream((File) arg);
                } else if (arg instanceof FileObject) {
                    in = new FileInputStream(((FileObject)arg).getFile());
                } else if (arg instanceof String) {
View Full Code Here

   
    /**
     * {@inheritDoc} Returns the adapted WSDL.
     */
    public InputStream getWSDL(HttpServletRequest req) throws IOException, WsException {
        return new ByteArrayInputStream(getAdaptedWsdl(req));
    }
View Full Code Here

    public void writeWSDL(OutputStream outputStream, HttpServletRequest req) throws IOException {
        outputStream.write(wsdlBytes);
    }

    public InputStream getWSDL(HttpServletRequest req) throws IOException {
        return new ByteArrayInputStream(wsdlBytes);
    }
View Full Code Here

        fileVO.setPhysical(CvFileVO.FP_PHYSICAL);
        fileVO.setPhysicalFolder(attachmentFolderID);
        fileVO.setAuthorId(individualID);
        fileVO.setIsTemporary(CvFileVO.FIT_YES);

        ByteArrayInputStream inputStream = new ByteArrayInputStream(originalBody.getBytes());

        try {
          CvFileFacade fileFacade = new CvFileFacade();
          newFileID = fileFacade.addFile(individualID, attachmentFolderID, fileVO, inputStream, dataSource);
        } catch (CvFileException cfe) {
View Full Code Here

      Arrays.fill(zeros, (byte)0);
      IvParameterSpec ivSpec = new IvParameterSpec(zeros);
      Cipher cipher = Cipher.getInstance("Blowfish/CBC/PKCS5Padding");
      cipher.init(Cipher.DECRYPT_MODE, blowfishKey, ivSpec);

      ByteArrayInputStream byteArrayInStream = new ByteArrayInputStream(cipher.doFinal(licenseFile));
      returnProperties = new Properties();
      returnProperties.load(byteArrayInStream);
    } catch (Exception exception) {
      logger.error("decryptLicenseFile: generic Exception", exception);
    }
View Full Code Here

              documentContent.append(ptContent.get(i));
              if (i != (ptContent.size() - 1)) {
                documentContent.append("<br><<Page Break>><br>");
              }
            }
            ByteArrayInputStream inputStream = new ByteArrayInputStream(documentContent.toString()
                .getBytes());
            // Add the File to the Files Module so that we can download it...
            int fileId = cvf.addFile(individualID, homeFld.getFolderId(), flvo, inputStream,
                dataSource);
            Message[2] = String.valueOf(fileId);
View Full Code Here

TOP

Related Classes of java.io.ByteArrayInputStream

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.