Package java.io

Examples of java.io.DataOutputStream.writeLong()


      while (iterA.hasNext())
        outStream.writeFloat(iterA.getFloatNext());

    } else if (classType == long.class) {
      while (iterA.hasNext())
        outStream.writeLong(iterA.getLongNext());

    } else if (classType == int.class) {
      while (iterA.hasNext())
        outStream.writeInt(iterA.getIntNext());
View Full Code Here


            }

            //  Write out the file header
            fileOut.writeInt(maxw);
            fileOut.writeInt(maxh);
            fileOut.writeLong((long)(delay * args.length));

            //  Write out the file itself
            fileOut.write( bout.toByteArray() );

            try { bout.close(); } catch(IOException e) {}
View Full Code Here

        ByteArrayOutputStream bo = new ByteArrayOutputStream();
        DataOutputStream o = new DataOutputStream(bo);
        o.writeByte((byte)2);
        o.writeShort((short)2);
        o.writeInt(2);
        o.writeLong(2L);
        o.writeFloat(1.1f);
        o.writeDouble(1.1);
        byte[] src = bo.toByteArray();

        LinkedBufferInput b = new LinkedBufferInput(1024);
View Full Code Here

        ByteArrayOutputStream bo = new ByteArrayOutputStream();
        DataOutputStream o = new DataOutputStream(bo);
        o.writeByte((byte)2);
        o.writeShort((short)2);
        o.writeInt(2);
        o.writeLong(2L);
        o.writeFloat(1.1f);
        o.writeDouble(1.1);
        byte[] src = bo.toByteArray();

        LinkedBufferInput b = new LinkedBufferInput(1024);
View Full Code Here

        o2.writeByte((byte)2);
        o1.writeShort((short)2);
        o2.writeShort((short)2);
        o1.writeInt(2);
        o2.writeInt(2);
        o1.writeLong(2L);
        o2.writeLong(2L);
        o1.writeFloat(1.1f);
        o2.writeFloat(1.1f);
        o1.writeDouble(1.1);
        o2.writeDouble(1.1);
View Full Code Here

        o2.writeByteAndShort((byte)9, (short)2);
        o1.writeByte((byte)9);
        o1.writeInt(2);
        o2.writeByteAndInt((byte)9, 2);
        o1.writeByte((byte)9);
        o1.writeLong(2L);
        o2.writeByteAndLong((byte)9, 2L);
        o1.writeByte((byte)9);
        o1.writeFloat(1.1f);
        o2.writeByteAndFloat((byte)9, 1.1f);
        o1.writeByte((byte)9);
View Full Code Here

      if (log.isDebugEnabled())
        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();
View Full Code Here

        }
        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();
View Full Code Here

            {
                if (logger.isLoggable(MLevel.INFO))
                    logger.log(MLevel.INFO, "Failed to get local InetAddress for VMID. This is unlikely to matter. At all. We'll add some extra randomness", e);
                dos.write( srand.nextInt() );
            }
            dos.writeLong(System.currentTimeMillis());
            dos.write( srand.nextInt() );
           
            int remainder = baos.size() % 4; //if it wasn't a 4 byte inet address
            if (remainder > 0)
            {
View Full Code Here

      while (entries.hasNext()) {
        Map.Entry entry = (Map.Entry) entries.next();
        IPath key = (IPath) entry.getKey();
        out.writeUTF(key.toPortableString());
        Long timestamp = (Long) entry.getValue();
        out.writeLong(timestamp.longValue());
      }
    } catch (IOException e) {
      IStatus status = new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, IStatus.ERROR, "Problems while saving timestamps", e); //$NON-NLS-1$
      throw new CoreException(status);
    } finally {
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.