Examples of OutputStreamWriter


Examples of java.io.OutputStreamWriter

            IOException, XQueryException {
        XQEngine engine = new XQEngineClient(remoteEndpoint);
        String query = IOUtils.toString(new FileInputStream(fileName));
        QueryRequest request = new QueryRequest(query, ReturnType.ASYNC_REMOTE_SEQUENCE);
        Sequence<Item> resultSeq = (Sequence<Item>) engine.execute(request);
        Writer writer = new FastBufferedWriter(new OutputStreamWriter(System.out), 4096);
        SAXWriter saxwr = new SAXWriter(writer, "UTF-8");
        Serializer ser = new SAXSerializer(saxwr, writer);
        ser.emit(resultSeq);
        writer.flush();
    }
View Full Code Here

Examples of java.io.OutputStreamWriter

        System.out.println("StartSocket: passing startup args to already-running process.");
       
    // NOTE - this formatting is also used by AzureusCoreSingleInstanceClient and other org.gudy.azureus2.ui.swt.StartSocket
       
        sck = new Socket("127.0.0.1",6880);
        pw = new PrintWriter(new OutputStreamWriter(sck.getOutputStream()));
        StringBuffer buffer = new StringBuffer(AzureusCoreSingleInstanceClient.ACCESS_STRING+";args;");
        for(int i = 0 ; i < args.length ; i++) {
          String arg = args[i].replaceAll("&","&&").replaceAll(";","&;");
          buffer.append(arg);
          buffer.append(';');
View Full Code Here

Examples of java.io.OutputStreamWriter

      path = path.substring(0,pos);
    }
   
    path = path.substring( PROVIDER.length()+1);

    XMLEscapeWriter pw = new XMLEscapeWriter( new PrintWriter(new OutputStreamWriter( response.getOutputStream(), "UTF-8" )));

    pw.setEnabled( false );
   
    if ( path.length() <= 1 ){
     
View Full Code Here

Examples of java.io.OutputStreamWriter

          // preserve UTF-8 BOM if it was found
       
        baos.write( new byte[]{ (byte)0xEF, (byte)0xBB, (byte)0xBF });
      }
     
      OutputStreamWriter osw = new OutputStreamWriter( baos );
     
      osw.write( fileContent );
     
      osw.close();
     
      FileOutputStream out = null;
           
      try{
       
View Full Code Here

Examples of java.io.OutputStreamWriter

    Throwable        e )
  {
    try{
      ByteArrayOutputStream  baos = new ByteArrayOutputStream();
     
      PrintWriter  pw = new PrintWriter( new OutputStreamWriter( baos ));
     
      e.printStackTrace( pw );
     
      pw.close();
     
View Full Code Here

Examples of java.io.OutputStreamWriter

        this.stop = stop;
    }

    public void run() {
        try {
            output = new PrintWriter(new OutputStreamWriter(control.getOutputStream(), Constants.UTF8));
            if (stop) {
                reply(421, "Too many users");
            } else {
                reply(220, SERVER_NAME);
                // TODO need option to configure the serverIpAddress?
View Full Code Here

Examples of java.io.OutputStreamWriter

    throw new NoImplException();
  }

  public PrintWriter getWriter() throws IOException {
    if (writer == null) {
      writer = new PrintWriter(new OutputStreamWriter(stream,
          characterEncoding));
    }
    return writer;
  }
View Full Code Here

Examples of java.io.OutputStreamWriter

    private void connect(String url) throws IOException {
        socket = NetUtils.createSocket(url, 21, false);
        InputStream in = socket.getInputStream();
        OutputStream out = socket.getOutputStream();
        reader = new BufferedReader(new InputStreamReader(in));
        writer = new PrintWriter(new OutputStreamWriter(out, Constants.UTF8));
        readCode(220);
    }
View Full Code Here

Examples of java.io.OutputStreamWriter

    public ReaderInputStream(Reader reader) {
        chars = new char[Constants.IO_BUFFER_SIZE];
        this.reader = reader;
        out = new ByteArrayOutputStream(Constants.IO_BUFFER_SIZE);
        try {
            writer = new BufferedWriter(new OutputStreamWriter(out, Constants.UTF8));
        } catch (UnsupportedEncodingException e) {
            throw DbException.convert(e);
        }
    }
View Full Code Here

Examples of java.io.OutputStreamWriter

    }

    private Writer openWebxmlWriter(File file) throws IOException {
        FileOutputStream fos = new FileOutputStream(file);
        try {
            return webxmlEncoding != null ? new OutputStreamWriter(fos,
                    webxmlEncoding) : new OutputStreamWriter(fos);
        } catch (IOException ex) {
            fos.close();
            throw ex;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.