Package java.io

Examples of java.io.DataInputStream.readLine()


    switch(line.charAt(0)) {
      case 'p':
      case 'P':
          out.print("key ? ") ; out.flush() ;
          key = in.readLine() ;
          out.print("value ? ") ; out.flush() ;
          value = in.readLine() ;
          value = (String ) ad.put(key,value) ;
          out.println("old: "+value) ;
          break ;
View Full Code Here


      case 'p':
      case 'P':
          out.print("key ? ") ; out.flush() ;
          key = in.readLine() ;
          out.print("value ? ") ; out.flush() ;
          value = in.readLine() ;
          value = (String ) ad.put(key,value) ;
          out.println("old: "+value) ;
          break ;
      case 'r':
      case 'R':
View Full Code Here

          out.println("old: "+value) ;
          break ;
      case 'r':
      case 'R':
          out.print("key ? ") ; out.flush() ;
          key = in.readLine() ;
          value = (String) ad.remove(key) ;
          out.println("old: "+value) ;
          break ;
      case 'g':
      case 'G':
View Full Code Here

          out.println("old: "+value) ;
          break ;
      case 'g':
      case 'G':
          out.print("key ? ") ; out.flush() ;
          key = in.readLine() ;
          value = (String) ad.get(key) ;
          out.println("value: "+value) ;
          break ;
      case 'd':
      case 'D':
View Full Code Here

      try {
    String      line = null ;
    DataInputStream in   = (new DataInputStream
          (new BufferedInputStream
           (new FileInputStream(filename)))) ;
    while ((line = in.readLine()) != null)
        urls.addElement(new URL(line)) ;
    in.close() ;
      } catch (Exception ex) {
    System.out.println("Unable to read URL file "+filename) ;
    ex.printStackTrace() ;
View Full Code Here

             + file.getAbsolutePath());
      return;
  }
  // Parse the file in:
  try {
      for (String line = null; (line = in.readLine()) != null; ) {
    // Syntax (FIXME)
    //   host udp-port http-location
    // | '#' comments
    if ( line.startsWith("#") || line.length() == 0 )
        continue;
View Full Code Here

        final OutputStream sockOut = socket.getOutputStream();
        final DataInputStream in = new DataInputStream(new TelnetInputStream(socket.getInputStream(), sockOut));
        final PrintStream out = new TelnetPrintStream(sockOut);

        assertEmptyLine(in);
        assertEquals("type 'help' for a list of commands", in.readLine());

        out.println("set a b");
        out.flush();
        assertReply("set a to b", in.readLine());
        assertEmptyLine(in);
View Full Code Here

        assertEmptyLine(in);
        assertEquals("type 'help' for a list of commands", in.readLine());

        out.println("set a b");
        out.flush();
        assertReply("set a to b", in.readLine());
        assertEmptyLine(in);

        out.println("get a");
        out.flush();
        assertReply("b", in.readLine());
View Full Code Here

        assertReply("set a to b", in.readLine());
        assertEmptyLine(in);

        out.println("get a");
        out.flush();
        assertReply("b", in.readLine());
        assertEmptyLine(in);

        out.println("list");
        out.flush();
        assertReply("a = b", in.readLine());
View Full Code Here

        assertReply("b", in.readLine());
        assertEmptyLine(in);

        out.println("list");
        out.flush();
        assertReply("a = b", in.readLine());
        assertEmptyLine(in);
    }
}
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.