Package java.io

Examples of java.io.InputStreamReader


    else
      commands.remove(commandName);
  }
 
  public ConsoleInput(String con, AzureusCore _azureus_core, InputStream _in, PrintStream _out, Boolean _controlling) {
    this(con, _azureus_core, new InputStreamReader(_in), _out, _controlling);
  }
View Full Code Here


      InputStream inR = this.getClass().getClassLoader()
        .getResourceAsStream("weka/gui/beans/README_KnowledgeFlow");

      // end modifications
      StringBuffer helpHolder = new StringBuffer();
      LineNumberReader lnr = new LineNumberReader(new InputStreamReader(inR));

      String line;

      while ((line = lnr.readLine()) != null) {
        helpHolder.append(line+"\n");
View Full Code Here

            InputStream inR = this.getClass().getClassLoader()
            .getResourceAsStream(path);
            m_mainKFPerspective.addTab("Untitled");
            XMLBeans xml = new XMLBeans(m_beanLayout, m_bcSupport,
                m_mainKFPerspective.getCurrentTabIndex());
            InputStreamReader isr = new InputStreamReader(inR);

            Vector v     = (Vector) xml.read(isr);
            Vector beans        = (Vector) v.get(XMLBeans.INDEX_BEANINSTANCES);
            Vector connections  = (Vector) v.get(XMLBeans.INDEX_BEANCONNECTIONS);
            isr.close();

            integrateFlow(beans, connections, false, false);
            notifyIsDirty();
            revalidate();
          } catch (Exception ex) {
View Full Code Here

   * @param flowName the name of the flow
   * @throws Exception if a problem occurs during de-serialization
   */
  public void loadLayout(InputStream is, boolean newTab,
      String flowName) throws Exception {
    InputStreamReader isr = new InputStreamReader(is);
    loadLayout(isr, newTab, flowName);
  }
View Full Code Here

 
  private String
  getFileContent()
    throws IOException
  {
    InputStreamReader reader = null;

    try{
      byte[]  file_bytes = FileUtil.readFileAsByteArray( new File( plistFile ));
     
        // handle UTF-8 encoded BOM EFBBBF
           
      if (   file_bytes.length > 3 &&
          file_bytes[0] == (byte)0xEF &&
          file_bytes[1] == (byte)0xBB &&
          file_bytes[2] == (byte)0xBF ){
       
        found_bom = true;
       
        reader = new InputStreamReader( new ByteArrayInputStream( file_bytes, 3, file_bytes.length - 3 ));
       
      }else{
       
        found_bom = false;
       
        reader = new InputStreamReader( new ByteArrayInputStream( file_bytes ));

      }
         
      //max 32KB
     
      int length = 32 * 1024;
     
      char[] buffer = new char[length];
     
      int offset = 0;
     
      int len = 0;
     
      while((len = reader.read(buffer,offset,length-offset)) > 0) {
        offset += len;
      }
     
      String result =  new String(buffer,0,offset);
     
      return result;
     
    } finally {
      if(reader != null) {
        reader.close();
      }
    }
   
   
    //return FileUtil.readFileAsString(new File(plistFile), 64*1024, "UTF-8" );
View Full Code Here

  public void run()
  {
    try
    {
      BufferedReader rd = new BufferedReader(
          new InputStreamReader(conn.getInputStream(), "UTF-8"));
      Logger logger = LogManager.getLogger();

      while(!stop)
      {
        AbstractCommand cmd = readNextCommand(rd);
View Full Code Here

        out.write(bytes);
        out.close();
    }

    private static Reader getReader() {
        return new InputStreamReader(Railroads.class.getResourceAsStream("help.csv"));
    }
View Full Code Here

                reply(421, "Too many users");
            } else {
                reply(220, SERVER_NAME);
                // TODO need option to configure the serverIpAddress?
                serverIpAddress = control.getLocalAddress().getHostAddress().replace('.', ',');
                BufferedReader input = new BufferedReader(new InputStreamReader(control.getInputStream()));
                while (!stop) {
                    String command = null;
                    try {
                        command = input.readLine();
                    } catch (IOException e) {
View Full Code Here

      }
    }
   
    @Override
    public void run() {
      InputStreamReader stdin = new InputStreamReader(System.in);
      char[] buffer = new char[32];
      while (true) {
        try {
          int nbytes = stdin.read(buffer);
          if (nbytes > 0) {
            char[] add = new char[nbytes];
            System.arraycopy(buffer, 0, add, 0, nbytes);
            synchronized (queue) {
              queue.addLast(add);
View Full Code Here

        invoke(m, this, new Object[0]);
        return true;
    }

    private void runShell() {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String last = "", line;
        System.out.println("Shell mode. Type the target, then [Enter]. Just [Enter] repeats the last target.");
        while (true) {
            System.out.print("build> ");
            try {
View Full Code Here

TOP

Related Classes of java.io.InputStreamReader

Copyright © 2015 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.