Package java.io

Examples of java.io.DataOutputStream.writeInt()


        int c = 0;
        Map.Entry<Long, Integer> e;
        while (i.hasNext()) {
            e = i.next();
            os.writeLong(e.getKey().longValue());
            os.writeInt(e.getValue().intValue());
            c++;
        }
        os.flush();
        os.close();
        tmp.renameTo(file);
View Full Code Here


        DataOutputStream( bout );
    for (int ic = 0; ic < items.length; ic++) {
      try {
        final Item item = items[ic];
        if (item instanceof ChoiceGroup) {
          dout.writeInt(((ChoiceGroup)item).getSelectedIndex());
          //#ifdef DLOGGING
          if (finestLoggable) {logger.finest("stored selected " + item.getLabel() + "," + ((ChoiceGroup)item).getSelectedIndex());}
          //#endif
        } else if (item instanceof TextField) {
          final String value = ((TextField)item).getString();
View Full Code Here

          //#ifdef DLOGGING
          if (finestLoggable) {logger.finest("stored selected " + item.getLabel() + "," + ((ChoiceGroup)item).getSelectedIndex());}
          //#endif
        } else if (item instanceof TextField) {
          final String value = ((TextField)item).getString();
          dout.writeInt(value.length());
          byte [] bvalue;
          try {
            bvalue = value.getBytes("UTF-8");
          } catch (UnsupportedEncodingException e) {
            bvalue = value.getBytes();
View Full Code Here

        cproperties.put(SETTINGS_NAME, SETTINGS_VERS);
        //#endif
        //#ifdef DLOGGING
        if (fineLoggable) {logger.fine("save region=" + region);}
        //#endif
        dout.writeInt( cproperties.size() );
        Enumeration e = cproperties.keys();
        while( e.hasMoreElements() ) {
          String name = (String) e.nextElement();
          String value = cproperties.get( name ).toString();
          //#ifdef DLOGGING
View Full Code Here

            ioe.printStackTrace();
          }
          //#ifdef DLOGGING
          if (finestLoggable) {logger.finest("value=" + value);}
          //#endif
          dout.writeInt( bvalue.length );
          dout.write( bvalue, 0, bvalue.length );
        }
       
        byte[] data = bout.toByteArray();
        //#ifdef DLOGGING
View Full Code Here

    if (this.externalTimeStamps == null) return;
    File timestamps = getTimeStampsFile();
    DataOutputStream out = null;
    try {
      out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(timestamps)));
      out.writeInt(this.externalTimeStamps.size());
      Iterator entries = this.externalTimeStamps.entrySet().iterator();
      while (entries.hasNext()) {
        Map.Entry entry = (Map.Entry) entries.next();
        IPath key = (IPath) entry.getKey();
        out.writeUTF(key.toPortableString());
View Full Code Here

    private void dispatchTranslatedData(IRandomAccessDataBuffer randomAccessDataBuffer, int dataId) throws IOException{
        SocketChannel socketChannel =  openDataTransferChane();
        Socket socket = socketChannel.socket();
        try {
            DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
            dos.writeInt(dataId);
            long len = randomAccessDataBuffer.length();
            if(randomAccessDataBuffer.transferTo(0, len , socketChannel)!=len){
                throw new IOException("unable to transfer all data");
            }
        } finally {
View Full Code Here

        cproperties.put(SETTINGS_NAME, SETTINGS_VERS);
        //#endif
        //#ifdef DLOGGING
//@        if (fineLoggable) {logger.fine("save region=" + region);}
        //#endif
        dout.writeInt( cproperties.size() );
        Enumeration e = cproperties.keys();
        while( e.hasMoreElements() ) {
          String name = (String) e.nextElement();
          String value = cproperties.get( name ).toString();
          //#ifdef DLOGGING
View Full Code Here

            ioe.printStackTrace();
          }
          //#ifdef DLOGGING
//@          if (finestLoggable) {logger.finest("value=" + value);}
          //#endif
          dout.writeInt( bvalue.length );
          dout.write( bvalue, 0, bvalue.length );
        }
       
        byte[] data = bout.toByteArray();
        //#ifdef DLOGGING
View Full Code Here

  @Deprecated
  static ByteBuffer toByteBufferV2(TransactionEventRecord record) {
    ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(512);
    DataOutputStream dataOutput = new DataOutputStream(byteOutput);
    try {
      dataOutput.writeInt(MAGIC_HEADER);
      dataOutput.writeShort(record.getRecordType());
      dataOutput.writeLong(record.getTransactionID());
      dataOutput.writeLong(record.getLogWriteOrderID());
      record.write(dataOutput);
      dataOutput.flush();
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.