Package java.io

Examples of java.io.DataOutputStream.writeUTF()


   {
      long hash = 0;
      ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(512);
      MessageDigest messagedigest = MessageDigest.getInstance("SHA");
      DataOutputStream dataoutputstream = new DataOutputStream(new DigestOutputStream(bytearrayoutputstream, messagedigest));
      dataoutputstream.writeUTF(methodDesc);
      dataoutputstream.flush();
      byte abyte0[] = messagedigest.digest();
      for (int j = 0; j < Math.min(8, abyte0.length); j++)
         hash += (long) (abyte0[j] & 0xff) << j * 8;
      return hash;
View Full Code Here


        log.debug("Writing message " + message.getId() + " '" + message.getSubject() + "' to disk");
        FileOutputStream fout = new FileOutputStream(new File(queueDirectory, String.valueOf(message.getId()) + ".msg"));
        try {
            DataOutputStream dout = new DataOutputStream(fout);
            dout.writeLong(message.getId());
            dout.writeUTF(message.getSinkName());
            dout.writeBoolean(message.isUrgent());
            dout.writeUTF(message.getSubject());
            for (Iterator i = message.getRecipients().iterator(); i.hasNext();) {
                Recipient r = (Recipient) i.next();
                dout.writeInt(r.getRecipientType());
View Full Code Here

        try {
            DataOutputStream dout = new DataOutputStream(fout);
            dout.writeLong(message.getId());
            dout.writeUTF(message.getSinkName());
            dout.writeBoolean(message.isUrgent());
            dout.writeUTF(message.getSubject());
            for (Iterator i = message.getRecipients().iterator(); i.hasNext();) {
                Recipient r = (Recipient) i.next();
                dout.writeInt(r.getRecipientType());
                dout.writeUTF(r.getRecipientAlias() == null ? "" : r.getRecipientAlias());
                dout.writeUTF(r.getRealmName() == null ? "" : r.getRealmName());
View Full Code Here

            dout.writeBoolean(message.isUrgent());
            dout.writeUTF(message.getSubject());
            for (Iterator i = message.getRecipients().iterator(); i.hasNext();) {
                Recipient r = (Recipient) i.next();
                dout.writeInt(r.getRecipientType());
                dout.writeUTF(r.getRecipientAlias() == null ? "" : r.getRecipientAlias());
                dout.writeUTF(r.getRealmName() == null ? "" : r.getRealmName());
            }
            dout.writeInt(0);
            for (Iterator i = message.getParameterNames(); i.hasNext();) {
                String key = (String) i.next();
View Full Code Here

            dout.writeUTF(message.getSubject());
            for (Iterator i = message.getRecipients().iterator(); i.hasNext();) {
                Recipient r = (Recipient) i.next();
                dout.writeInt(r.getRecipientType());
                dout.writeUTF(r.getRecipientAlias() == null ? "" : r.getRecipientAlias());
                dout.writeUTF(r.getRealmName() == null ? "" : r.getRealmName());
            }
            dout.writeInt(0);
            for (Iterator i = message.getParameterNames(); i.hasNext();) {
                String key = (String) i.next();
                dout.writeInt(1);
View Full Code Here

            }
            dout.writeInt(0);
            for (Iterator i = message.getParameterNames(); i.hasNext();) {
                String key = (String) i.next();
                dout.writeInt(1);
                dout.writeUTF(key);
                dout.writeUTF(message.getParameter(key));
            }
            dout.writeInt(0);
            dout.writeUTF(message.getContent());
            dout.writeUTF(message.getLastMessage());
View Full Code Here

            dout.writeInt(0);
            for (Iterator i = message.getParameterNames(); i.hasNext();) {
                String key = (String) i.next();
                dout.writeInt(1);
                dout.writeUTF(key);
                dout.writeUTF(message.getParameter(key));
            }
            dout.writeInt(0);
            dout.writeUTF(message.getContent());
            dout.writeUTF(message.getLastMessage());
        } finally {
View Full Code Here

                dout.writeInt(1);
                dout.writeUTF(key);
                dout.writeUTF(message.getParameter(key));
            }
            dout.writeInt(0);
            dout.writeUTF(message.getContent());
            dout.writeUTF(message.getLastMessage());
        } finally {
            fout.close();
        }
    }
View Full Code Here

                dout.writeUTF(key);
                dout.writeUTF(message.getParameter(key));
            }
            dout.writeInt(0);
            dout.writeUTF(message.getContent());
            dout.writeUTF(message.getLastMessage());
        } finally {
            fout.close();
        }
    }
View Full Code Here

            dos = new DataOutputStream(bos);

            /*
             * 1. The class name written using UTF encoding.
             */
            dos.writeUTF(name.replace('/', '.'));

            /*
             * 2. The class modifiers written as a 32-bit integer.
             */
            dos.writeInt(access
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.