Examples of writeChars()


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

Examples of java.io.DataOutputStream.writeChars()

                        //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

Examples of java.io.DataOutputStream.writeChars()

  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

Examples of java.io.DataOutputStream.writeChars()

      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

Examples of java.io.DataOutputStream.writeChars()

      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

Examples of java.io.DataOutputStream.writeChars()

    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

Examples of java.io.DataOutputStream.writeChars()

            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

Examples of java.io.DataOutputStream.writeChars()

    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

Examples of java.io.ObjectOutputStream.writeChars()

                                                                                IOException {
        if (objs.length != names.length) throw new IOException("array length isn't equal.");
        ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(fileName));
        out.writeInt(objs.length);
        for (int i = 0; i < objs.length; i++) {
            out.writeChars(names[i]);
            out.writeInt(objs[i].length);
            for (KeyPointN kp : objs[i]) {
                out.writeObject(kp);
            }
        }
View Full Code Here

Examples of java.io.RandomAccessFile.writeChars()

        // Then fill in the sspace information
        switch (format) {
        case TEXT:
        case SPARSE_TEXT:
            //PrintWriter pw = new PrintWriter(fos);
            raf.writeChars(vectorsSeen + " " + vectorLength);
            break;
        case BINARY:
        case SPARSE_BINARY:
            raf.writeInt(vectorsSeen); // # of vectors
            raf.writeInt(vectorLength); // # of dimensions
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.