Package java.io

Examples of java.io.InputStreamReader


 
  public static void copyWithVariableSubstitution(File source, File target, Map<String,String> variables, String varPrefix, String varSuffix) throws IOException {
    BufferedReader reader = null;
    BufferedWriter writer = null;
    try {
      reader = new BufferedReader(new InputStreamReader(new FileInputStream(source)));
      writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(target)));
      String line = reader.readLine();
      while (line != null) {
        line = substitute(line, variables, varPrefix, varSuffix);
        writer.write(line + "\n");
View Full Code Here


    public TagSoupAutoDetector() {
    }

    public Reader autoDetectingReader(InputStream i) {
        try {
            return new InputStreamReader(i, "UTF-8");
        } catch (UnsupportedEncodingException ex) {
            return new InputStreamReader(i);
        }
    }
View Full Code Here

    if (is != null) {
      StringBuilder sb = new StringBuilder();
      String line;

      try {
        BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        while ((line = reader.readLine()) != null) {
          sb.append(line).append("\n");
        }
      } finally {
        is.close();
View Full Code Here

        } else {
          charset = UTF_16LE;
        }
      }
    }
    Reader r = new InputStreamReader(pStream, charset);
    return jsonToXml(context, rootName, r);
    }
View Full Code Here

      metaData.setDirectAccess(metaDataFile.isDirectAccess());
    }

    BufferedReader reader = null;
    try {
      reader = new BufferedReader(new InputStreamReader(tmlFile.getContents()));
      String readLine = null;
      readLine = reader.readLine();
      while (readLine != null && readLine.startsWith("##MDSET ")) {
        try {
        metaData.processDesignHeader(readLine);
View Full Code Here

        m_format.setCalendar(calendar);
*/        try {
           
            // load the earthquake database
            BufferedReader rrdr = new BufferedReader
                (new InputStreamReader(QuakeBase.class.
                getResourceAsStream("/regions.txt")));
            readRegions(rrdr);
            BufferedReader qrdr =
                new BufferedReader(new InputStreamReader(QuakeBase.class.
                getResourceAsStream("/fulldata.txt")));
            readQuakes(qrdr);
            for (int i = 0; i < m_seismicInfos.length; i++) {
                m_seismicInfos[i].fix();
            }
View Full Code Here

      BufferedReader br = null;
      try {
        Socket sck = socket.accept();
        String address = sck.getInetAddress().getHostAddress();
        if (address.equals("localhost") || address.equals("127.0.0.1")) {
          br = new BufferedReader(new InputStreamReader(sck.getInputStream()));
          String line = br.readLine();
          //System.out.println("received : " + line);
          if (line != null) {
            //            main.showMainWindow();
            StringTokenizer st = new StringTokenizer(line, ";");
View Full Code Here

  public void createNewConsoleInput(String consoleName, InputStream inputStream, PrintStream outputStream, UserProfile profile)
  {
    ConsoleInput console;
    if( userManager != null )
    {
      MultiUserConsoleInput muc = new MultiUserConsoleInput(consoleName, UIConst.getAzureusCore(), new InputStreamReader(inputStream), outputStream, Boolean.FALSE, profile);
      muc.registerCommand( new UserCommand(userManager) );
      console = muc;
    }
    else
    {
      console = new ConsoleInput(consoleName, UIConst.getAzureusCore(), new InputStreamReader(inputStream), outputStream, Boolean.FALSE, profile);
     
      System.out.println( "TelnetUI: console input instantiated" );
   
    console.printwelcome();
    console.printconsolehelp();
View Full Code Here

  {
    if( userManager == null )
      return UserProfile.DEFAULT_USER_PROFILE;
   
    PrintStream ps = new PrintStream(out);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    ps.print("Username: ");
    String username = br.readLine();
    ps.print("Password: ");
    String password = br.readLine();
    UserProfile userProfile = userManager.authenticate(username, password);
View Full Code Here

    super( "" );
    this.out = _out;
    this.azureus_core  = _azureus_core;
    this.userProfile   = UserProfile.DEFAULT_USER_PROFILE;
    this.controlling   = false;
    this.br       = new CommandReader( new InputStreamReader( new ByteArrayInputStream(new byte[0])));
       
    if (Logger.getRootLogger().getAppender("ConsoleAppender")==null) {
        Appender app;
        app = new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN));
        app.setName("ConsoleAppender");
View Full Code Here

TOP

Related Classes of java.io.InputStreamReader

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.