Package java.io

Examples of java.io.DataOutputStream.writeChar()


    private List<Object> generateACharUpdate(int fieldId) throws IOException {
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        DataOutputStream dout = new DataOutputStream(bout);

        dout.writeChar(5);

        List<Object> update = new ArrayList<Object>();
        update.add(PacketReader.UPDATE);
        update.add(fieldId);
        update.add(bout.toByteArray()); // Data
View Full Code Here


      } else {
        dos.writeInt(stringHeapLength);
      }

      // write 0 as first char buffer
      dos.writeChar(0);

      // write the data in the stringheap
      if (cas.stringHeap.charHeapPos > 0)
        dos.writeChars(String.valueOf(cas.stringHeap.stringHeap));
View Full Code Here

        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.stringHeap.stringList.get(ref));
          dos.writeChar(0); // null terminate each string
          // update pos
          pos += 1 + ((String) cas.stringHeap.stringList.get(ref)).length();
        }
      }
View Full Code Here

        }
      }

      // word alignment
      if (stringHeapLength % 2 != 0) {
        dos.writeChar(0);
      }

      // write out the string ref heap
      // each reference consist of a offset into stringheap and a length
      int refheapsz = ((refheap.length - StringHeap.FIRST_CELL_REF) / StringHeap.REF_HEAP_CELL_SIZE) * 2;
 
View Full Code Here

      }

      // word alignment
      align = shortheapsz - (cas.shortHeap.getSize());
      for (int i = 0; i < align; i++) {
        dos.writeChar(0);
      }

      // 64bit heap
      int longheapsz = cas.longHeap.getSize();
      dos.writeInt(longheapsz);
View Full Code Here

    } finally {
      dataXceiverServer.balanceThrottler.release();
      if (isOpSuccess) {
        try {
          // send one last byte to indicate that the resource is cleaned.
          reply.writeChar('d');
        } catch (IOException ignored) {
        }
      }
      IOUtils.closeStream(reply);
      IOUtils.closeStream(blockSender);
View Full Code Here

    } finally {
      dataXceiverServer.balanceThrottler.release();
      if (isOpSuccess) {
        try {
          // send one last byte to indicate that the resource is cleaned.
          reply.writeChar('d');
        } catch (IOException ignored) {
        }
      }
      IOUtils.closeStream(reply);
      IOUtils.closeStream(blockSender);
View Full Code Here

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream datas = null;
       
        try {
            datas = new DataOutputStream(out);
            datas.writeChar(c);
        } finally {
            if ( datas != null ) datas.close();
        }
       
        try {
View Full Code Here

    } finally {
      dataXceiverServer.balanceThrottler.release();
      if (isOpSuccess) {
        try {
          // send one last byte to indicate that the resource is cleaned.
          reply.writeChar('d');
        } catch (IOException ignored) {
        }
      }
      IOUtils.closeStream(reply);
      IOUtils.closeStream(blockSender);
View Full Code Here

         /* write the index (stage 1) array and the 16/32-bit data (stage 2) array */
         if(reduceTo16Bits) {
             /* write 16-bit index values shifted right by UTRIE_INDEX_SHIFT, after adding indexLength */
             for (int i=0; i<m_indexLength_; i++) {
                 int v = (m_index_[i] + m_indexLength_) >>> Trie.INDEX_STAGE_2_SHIFT_;
                 dos.writeChar(v);
             }
            
             /* write 16-bit data values */
             for(int i=0; i<m_dataLength_; i++) {
                 int v = m_data_[i] & 0x0000ffff;
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.