Package java.io

Examples of java.io.DataOutputStream.writeLong()


            for (long timestep : sspace.getTimeSteps(word)) {
                Vector timeSlice =
                    sspace.getVectorBetween(word, timestep, timestep + 1);
                if (timeSlice != null) {
                    dos.writeLong(timestep);
                    for (int i = 0; i < timeSlice.length(); ++i) {
                        dos.writeDouble(timeSlice.getValue(i).doubleValue());
                    }
                }
            }
View Full Code Here


                        if (timeSlice.getValue(i).doubleValue()  != 0d) {
                            nonZero++;
                        }
                    }

                    dos.writeLong(timestep);
                    dos.writeInt(nonZero);
                    for (int i = 0; i < timeSlice.length(); ++i) {
                        double d = timeSlice.getValue(i).doubleValue();
                        if (d != 0d) {
                            dos.writeInt(i);
View Full Code Here

            System.out.println("Encrypted password with "+iterations+" iterations.");
        }

    DataOutputStream dos = new DataOutputStream(baos);
    dos.writeInt(VERSION);
    dos.writeLong(iterations);
    baos.write(salt);
    baos.write(iv);
    int hashedStart = salt.length + iv.length + 4 + 8;
    dos.writeLong(flags);
    baos.write(clientCacheMasterKey);
View Full Code Here

    dos.writeInt(VERSION);
    dos.writeLong(iterations);
    baos.write(salt);
    baos.write(iv);
    int hashedStart = salt.length + iv.length + 4 + 8;
    dos.writeLong(flags);
    baos.write(clientCacheMasterKey);
    baos.write(databaseKey);
    baos.write(tempfilesMasterSecret);
   
    byte[] data = baos.toByteArray();
View Full Code Here

  public IInteger uuidi() {
    UUID uuid = UUID.randomUUID();
    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    DataOutputStream data = new DataOutputStream(bytes);
    try {
      data.writeLong(uuid.getMostSignificantBits());
      data.writeLong(uuid.getLeastSignificantBits());
      return values.integer(bytes.toByteArray());
    } catch (IOException e) {
      throw RuntimeExceptionFactory.io(values.string("could not generate unique number " + uuid), null, null);
    }
View Full Code Here

    UUID uuid = UUID.randomUUID();
    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    DataOutputStream data = new DataOutputStream(bytes);
    try {
      data.writeLong(uuid.getMostSignificantBits());
      data.writeLong(uuid.getLeastSignificantBits());
      return values.integer(bytes.toByteArray());
    } catch (IOException e) {
      throw RuntimeExceptionFactory.io(values.string("could not generate unique number " + uuid), null, null);
    }
  }
View Full Code Here

        //
        // Header info
        //
        out.writeShort(DataTransferProtocol.DATA_TRANSFER_VERSION);
        out.writeByte(DataTransferProtocol.OP_WRITE_BLOCK);
        out.writeLong(b.getBlockId());
        out.writeLong(b.getGenerationStamp());
        out.writeInt(0);           // no pipelining
        out.writeBoolean(false);   // not part of recovery
        Text.writeString(out, ""); // client
        out.writeBoolean(true); // sending src node information
View Full Code Here

        // Header info
        //
        out.writeShort(DataTransferProtocol.DATA_TRANSFER_VERSION);
        out.writeByte(DataTransferProtocol.OP_WRITE_BLOCK);
        out.writeLong(b.getBlockId());
        out.writeLong(b.getGenerationStamp());
        out.writeInt(0);           // no pipelining
        out.writeBoolean(false);   // not part of recovery
        Text.writeString(out, ""); // client
        out.writeBoolean(true); // sending src node information
        srcNode.write(out); // Write src node DatanodeInfo
View Full Code Here

      DataOutputStream out = new DataOutputStream(
          s.getOutputStream());

      out.writeShort( DataTransferProtocol.DATA_TRANSFER_VERSION );
      out.write( DataTransferProtocol.OP_WRITE_BLOCK );
      out.writeLong( block.getBlock().getBlockId());
      out.writeLong( block.getBlock().getGenerationStamp() );
      out.writeInt(1);
      out.writeBoolean( false );       // recovery flag
      Text.writeString( out, "" );
      out.writeBoolean(false); // Not sending src node information
View Full Code Here

          s.getOutputStream());

      out.writeShort( DataTransferProtocol.DATA_TRANSFER_VERSION );
      out.write( DataTransferProtocol.OP_WRITE_BLOCK );
      out.writeLong( block.getBlock().getBlockId());
      out.writeLong( block.getBlock().getGenerationStamp() );
      out.writeInt(1);
      out.writeBoolean( false );       // recovery flag
      Text.writeString( out, "" );
      out.writeBoolean(false); // Not sending src node information
      out.writeInt(0);
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.