Package java.io

Examples of java.io.DataInputStream.readLine()


            Address local=ht.getLocalAddress();
            long start, stop;
            System.out.print("Number of entries: ");
            System.out.flush();
            System.in.skip(System.in.available());
            String line=in.readLine();
            int num=Integer.parseInt(line);
            start=System.currentTimeMillis();
            for(int i=0; i < num; i++) {
                if(i % 100 == 0)
                    System.out.print(i + " ");
View Full Code Here


            Set keys;
            long start, stop;
            System.out.print("Number of entries: ");
            System.out.flush();
            System.in.skip(System.in.available());
            String line=in.readLine();
            int num=Integer.parseInt(line);
            Object key;
            int i=0;

            Iterator it=ht.keySet().iterator();
View Full Code Here


            in=new DataInputStream(System.in);
            while(true) {
                System.out.print("> ");
                line=in.readLine();
                if(line.startsWith("quit") || line.startsWith("exit")) {
                    if(ack_receiver != null)
                        ack_receiver.stop();
                    break;
                }
View Full Code Here

            }

            in=new DataInputStream(System.in);
            while(true) {
                System.out.print("> ");
                line=in.readLine();
                if(line.startsWith("quit") || line.startsWith("exit"))
                    System.exit(0);
                buf=line.getBytes();
                packet=new DatagramPacket(buf, buf.length, mcast_addr, port);
                send(packet, sockets); // send on all interfaces
View Full Code Here

    protected String getHeaderValue(String frame, String header) throws IOException {
        DataInput input = new DataInputStream(new ByteArrayInputStream(frame.getBytes()));
        String line;
        for (int idx = 0; /* forever, sort of */; ++idx) {
            line = input.readLine();
            if (line == null) {
                // end of message, no headers
                return null;
            }
            line = line.trim();
View Full Code Here

                new DataInputStream(new KeepAliveInputStream(getInputStream()));
            do {
                System.err.println(prompt);
                System.err.flush();
                try {
                    String input = in.readLine();
                    request.setInput(input);
                } catch (IOException e) {
                    throw new BuildException("Failed to read input from"
                                             + " Console.", e);
                }
View Full Code Here

      assertEquals(2, t.size());
      if(t.get(0) != null) {
        // If underlying data-field is empty. PigStorage inserts null instead
        // of empty String objects.
        assertTrue(t.get(0) instanceof String);
        assertEquals(stream.readLine(), t.get(0));
      }
      else{
        assertTrue(stream.readLine().isEmpty());
      }
      assertTrue(t.get(1) instanceof String);
View Full Code Here

        // of empty String objects.
        assertTrue(t.get(0) instanceof String);
        assertEquals(stream.readLine(), t.get(0));
      }
      else{
        assertTrue(stream.readLine().isEmpty());
      }
      assertTrue(t.get(1) instanceof String);

      assertEquals("2010-10-10", t.get(1));
    }
View Full Code Here

    // Read the entire query
    boolean excludeQuery = false;
    String hadoopVer = ShimLoader.getMajorVersion();
    while (dis.available() != 0) {
      String line = dis.readLine();

      // While we are reading the lines, detect whether this query wants to be
      // excluded from running because the Hadoop version is incorrect
      Matcher matcher = pattern.matcher(line);
      if (matcher.find()) {
View Full Code Here

      System.out.println();
      System.out.println(commands);
      System.out.print("\t>> ");
     
      try {
        String command  = stdin.readLine().trim();
       
        if(command.equals("quit"))
        {
          isRunning = false;
        }
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.