Package java.io

Examples of java.io.DataOutputStream.writeChars()


        dos.writeInt(stringTotalLength);

            //write the data in the stringheap, if there is any
            if (stringTotalLength > 0) {
                if (cas.getStringHeap().charHeapPos > 0) {
                    dos.writeChars( String.valueOf(cas.getStringHeap().stringHeap, 0, cas.getStringHeap().charHeapPos) );
                }
                else {
                    // no stringheap data
                    //if there is data in the string lists, write a leading 0
                    if ( stringListLength > 0 ) {
View Full Code Here


                        //this is a string in the string list
                        if (ref !=0) {
                            //update the ref         
                            refheap[i+StringHeap.CHAR_HEAP_POINTER_OFFSET] = pos;
                            //write out the chars in the string
                            dos.writeChars((String)cas.getStringHeap().stringList.get(ref));
                            dos.writeChar(0); // null terminate each string
                            //update pos
                            pos += 1 + ((String) cas.getStringHeap().stringList.get(ref)).length();
                        }       
                    }
View Full Code Here

  public static void saveVoiture(File file, Voiture voiture) throws IOException{
    FileOutputStream fos = new FileOutputStream(file);
    DataOutputStream dos = new DataOutputStream(fos);
   
    dos.writeInt(voiture.getNom().length());
    dos.writeChars(voiture.getNom());
  }
}
View Full Code Here

      dos.writeInt(stringTotalLength);

      // write the data in the stringheap, if there is any
      if (stringTotalLength > 0) {
        if (shdh.charHeapPos > 0) {
          dos.writeChars(String.valueOf(shdh.charHeap, 0, shdh.charHeapPos));
        } else {
          // no stringheap data
          // if there is data in the string lists, write a leading 0
          if (stringListLength > 0) {
            dos.writeChar(0);
View Full Code Here

      dos.writeInt(stringTotalLength);

      // write the data in the stringheap, if there is any
      if (stringTotalLength > 0) {
        if (shdh.charHeapPos > 0) {
          dos.writeChars(String.valueOf(shdh.charHeap, 0, shdh.charHeapPos));
        } else {
          // no stringheap data
          // if there is data in the string lists, write a leading 0
          if (stringListLength > 0) {
            dos.writeChar(0);
View Full Code Here

    private static String eTagHash(Dataset dataSet, HttpServletRequest request)
            throws IOException, NoSuchAlgorithmException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        dos.writeLong(dataSet.published.getTime());
        dos.writeChars(request.getHeader("User-Agent"));
        dos.writeChars(request.getQueryString());
        return Base64.encodeBase64String(
                MessageDigest.getInstance("MD5").digest(bos.toByteArray()));
    }
   
View Full Code Here

            throws IOException, NoSuchAlgorithmException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        dos.writeLong(dataSet.published.getTime());
        dos.writeChars(request.getHeader("User-Agent"));
        dos.writeChars(request.getQueryString());
        return Base64.encodeBase64String(
                MessageDigest.getInstance("MD5").digest(bos.toByteArray()));
    }
   
    /**
 
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

      dos.writeInt(stringTotalLength);

      // write the data in the stringheap, if there is any
      if (stringTotalLength > 0) {
        if (cas.getStringHeap().charHeapPos > 0) {
          dos.writeChars(String.valueOf(cas.getStringHeap().stringHeap, 0,
              cas.getStringHeap().charHeapPos));
        } else {
          // no stringheap data
          // if there is data in the string lists, write a leading 0
          if (stringListLength > 0) {
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.