Package java.io

Examples of java.io.DataOutputStream.writeLong()


    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();
      // TODO toByteArray does an unneeded copy
      return ByteBuffer.wrap(byteOutput.toByteArray());
View Full Code Here


    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();
      // TODO toByteArray does an unneeded copy
      return ByteBuffer.wrap(byteOutput.toByteArray());
    } catch(IOException e) {
View Full Code Here

                Class superType = type.getSuperclass();
                if (superType != null) {
                    TypeDescriptor desc = getTypeRepository().getDescriptor(
                            superType);
                    out.writeLong(desc.getHashCode());
                }

                if (_write_object_method == null)
                    out.writeInt(1);
                else
View Full Code Here

    // so that when this db is booted by 1.1x and 1.2x JBMS, a IOException
    // stack trace rather than some error message that tells
    // the user to delete the database will show up.
    daos.writeInt(OBSOLETE_LOG_VERSION_NUMBER);
    daos.writeLong(value);

    if (onDiskMajorVersion == 0) {
      onDiskMajorVersion = jbmsVersion.getMajorVersion();
      onDiskMinorVersion = jbmsVersion.getMinorVersion();
      onDiskBeta = jbmsVersion.isBeta();
View Full Code Here

     long spare = 0;
      
    daos.writeByte(0);
    daos.writeByte(0);
        daos.writeByte(0);
    daos.writeLong(spare);
    daos.flush();
    // write the checksum for the control data written
    checksum.reset();
    checksum.update(baos.toByteArray(), 0, baos.size());
    daos.writeLong(checksum.getValue());
View Full Code Here

    daos.writeLong(spare);
    daos.flush();
    // write the checksum for the control data written
    checksum.reset();
    checksum.update(baos.toByteArray(), 0, baos.size());
    daos.writeLong(checksum.getValue());
    daos.flush();

    try
    {
            checkCorrupt();
View Full Code Here

    // so that when this db is booted by 1.1x and 1.2x JBMS, a IOException
    // stack trace rather than some error message that tells
    // the user to delete the database will show up.
    daos.writeInt(OBSOLETE_LOG_VERSION_NUMBER);
    daos.writeLong(value);

    if (onDiskMajorVersion == 0) {
      onDiskMajorVersion = jbmsVersion.getMajorVersion();
      onDiskMinorVersion = jbmsVersion.getMinorVersion();
      onDiskBeta = jbmsVersion.isBeta();
View Full Code Here

     long spare = 0;
      
    daos.writeByte(0);
    daos.writeByte(0);
        daos.writeByte(0);
    daos.writeLong(spare);
    daos.flush();
    // write the checksum for the control data written
    checksum.reset();
    checksum.update(baos.toByteArray(), 0, baos.size());
    daos.writeLong(checksum.getValue());
View Full Code Here

    daos.writeLong(spare);
    daos.flush();
    // write the checksum for the control data written
    checksum.reset();
    checksum.update(baos.toByteArray(), 0, baos.size());
    daos.writeLong(checksum.getValue());
    daos.flush();

    try
    {
            checkCorrupt();
View Full Code Here

            UUID uuid = UUID.randomUUID();
            ByteArrayOutputStream output = new ByteArrayOutputStream();
            DataOutputStream dataOut = new DataOutputStream(output);
            try
            {
                dataOut.writeLong(uuid.getMostSignificantBits());
                dataOut.writeLong(uuid.getLeastSignificantBits());
                dataOut.flush();
                dataOut.close();
            }
            catch (IOException e)
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.