Package java.io

Examples of java.io.DataOutputStream.writeChars()


            } else if (document instanceof Reader) {
                char[] buf = new char[1024 * 8];
                int count = 0;

                while ((count = ((Reader) document).read(buf, 0, buf.length)) != -1) {
                    bw.writeChars(new String(buf, 0, count));
                }
                ((Reader) document).close();
            }
        }

View Full Code Here


    Path path = new Path(inDir, fileName);
    final short replication = 2;
    DataOutputStream out = fs.create(path, true, 4096,
                                     replication, 512, null);
    for(int i=0; i < 1000; ++i) {
      out.writeChars("Hello\n");
    }
    out.close();
    System.out.println("Wrote file");
    DFSTestUtil.waitReplication(fs, path, replication);
  }
View Full Code Here

    Path path = new Path(location);

    // create a multi-block file on hdfs
    DataOutputStream out = fs.create(path, true, 4096, (short) 2, 512, null);
    for (int i = 0; i < 1000; ++i) {
      out.writeChars("Hello\n");
    }
    out.close();

    return path;
  }
View Full Code Here

    Path path = new Path(location);

    // create a multi-block file on hdfs
    DataOutputStream out = fs.create(path, true, 4096, (short) 2, 512, null);
    for (int i = 0; i < 1000; ++i) {
      out.writeChars("Hello\n");
    }
    out.close();

    return path;
  }
View Full Code Here

    Path path = new Path(inDir, fileName);
    final short replication = 2;
    DataOutputStream out = fs.create(path, true, 4096,
                                     replication, 512, null);
    for(int i=0; i < 1000; ++i) {
      out.writeChars("Hello\n");
    }
    out.close();
    System.out.println("Wrote file");
    DFSTestUtil.waitReplication(fs, path, replication);
  }
View Full Code Here

    Path path = new Path(location);

    // create a multi-block file on hdfs
    DataOutputStream out = fs.create(path, true, 4096, (short) 2, 512, null);
    for (int i = 0; i < 1000; ++i) {
      out.writeChars("Hello\n");
    }
    out.close();

    return path;
  }
View Full Code Here

  throws IOException {
    // create a multi-block file on hdfs
    DataOutputStream out = fs.create(new Path(inDir, fileName), true, 4096,
                                     (short) 2, 512, null);
    for(int i=0; i < 1000; ++i) {
      out.writeChars("Hello\n");
    }
    out.close();
    System.out.println("Wrote file");
  }
 
View Full Code Here

      try {
        Socket socket = serverSocket.accept();
        DataOutputStream out = new DataOutputStream(socket.getOutputStream());

        //writeUTF() will produce a leading byte-order character which messes up some clients
        out.writeChars(HTTP_RESPONSE_OK);
        out.close();
        socket.close();
       
      } catch (Exception e) {
        LOG.error("Server side communication problem on port:'{}' message:'{}'", listeningPort , e.getMessage());
View Full Code Here

    Path path = new Path(inDir, fileName);
    final short replication = 2;
    DataOutputStream out = fs.create(path, true, 4096,
                                     replication, 512, null);
    for(int i=0; i < 1000; ++i) {
      out.writeChars("Hello\n");
    }
    out.close();
    System.out.println("Wrote file");
    DFSTestUtil.waitReplication(fs, path, replication);
  }
View Full Code Here

      Path path = new Path("/foo/bar");
      // create a multi-block file on hdfs
      DataOutputStream out = fs.create(path, true, 4096,
                                       (short) 2, 512, null);
      for(int i=0; i < 1000; ++i) {
        out.writeChars("Hello\n");
      }
      out.close();
      System.out.println("Wrote file");

      // split it using a file input format
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.