Package org.apache.derby.iapi.services.io

Examples of org.apache.derby.iapi.services.io.ArrayOutputStream


     *
     * @exception  StandardException  Standard exception policy.
     **/
    private void createOutStreams()
    {
        rawDataOut = new ArrayOutputStream();
        rawDataOut.setData(pageData);

        logicalDataOut = new FormatIdOutputStream(rawDataOut);
    }
View Full Code Here


  {
    if (SanityManager.DEBUG)
      SanityManager.ASSERT(a.length >= CONTAINER_INFO_SIZE,
                 "header won't fit in array");

    ArrayOutputStream a_out = new ArrayOutputStream(a);
    FormatIdOutputStream outStream = new FormatIdOutputStream(a_out);

    int status = 0;
    if (getDroppedState()) status |= FILE_DROPPED;
    if (getCommittedDropState()) status |= FILE_COMMITTED_DROP;
    if (isReusableRecordId()) status |= FILE_REUSABLE_RECORDID;

    a_out.setPosition(0);
    a_out.setLimit(CONTAINER_INFO_SIZE);
    outStream.writeInt(formatIdInteger);
    outStream.writeInt(status);
    outStream.writeInt(pageSize);
    outStream.writeInt(spareSpace);
    outStream.writeInt(minimumRecordSize);
    outStream.writeShort(initialPages);
    outStream.writeShort(PreAllocSize);    // write spare1
    outStream.writeLong(firstAllocPageNumber);
    outStream.writeLong(firstAllocPageOffset);
    outStream.writeLong(containerVersion);
    outStream.writeLong(estimatedRowCount);
    outStream.writeLong(reusableRecordIdSequenceNumber);
    outStream.writeLong(0);    //Write spare3

    checksum.reset();
    checksum.update(a, 0, CONTAINER_INFO_SIZE - CHECKSUM_SIZE);

    // write the checksum to the array
    outStream.writeLong(checksum.getValue());

    a_out.clearLimit();
  }
View Full Code Here

  {
    if (SanityManager.DEBUG)
      SanityManager.ASSERT(a.length >= CONTAINER_INFO_SIZE,
                 "header won't fit in array");

    ArrayOutputStream a_out = new ArrayOutputStream(a);
    FormatIdOutputStream outStream = new FormatIdOutputStream(a_out);

    int status = 0;
    if (getDroppedState()) status |= FILE_DROPPED;
    if (getCommittedDropState()) status |= FILE_COMMITTED_DROP;
    if (isReusableRecordId()) status |= FILE_REUSABLE_RECORDID;

    a_out.setPosition(0);
    a_out.setLimit(CONTAINER_INFO_SIZE);
    outStream.writeInt(formatIdInteger);
    outStream.writeInt(status);
    outStream.writeInt(pageSize);
    outStream.writeInt(spareSpace);
    outStream.writeInt(minimumRecordSize);
    outStream.writeShort(initialPages);
    outStream.writeShort(PreAllocSize);    // write spare1
    outStream.writeLong(firstAllocPageNumber);
    outStream.writeLong(firstAllocPageOffset);
    outStream.writeLong(containerVersion);
    outStream.writeLong(estimatedRowCount);
    outStream.writeLong(reusableRecordIdSequenceNumber);
    outStream.writeLong(0);    //Write spare3

    checksum.reset();
    checksum.update(a, 0, CONTAINER_INFO_SIZE - CHECKSUM_SIZE);

    // write the checksum to the array
    outStream.writeLong(checksum.getValue());

    a_out.clearLimit();
  }
View Full Code Here

     *
     * @exception  StandardException  Standard exception policy.
     **/
    private void createOutStreams()
    {
        rawDataOut = new ArrayOutputStream();
        rawDataOut.setData(pageData);

        logicalDataOut = new FormatIdOutputStream(rawDataOut);
    }
View Full Code Here

        databaseEncrypted = true;
      }
      checksumLogRecordSize = checksumLength  + LOG_RECORD_FIXED_OVERHEAD_SIZE;

      //streams required to convert a log record to raw byte array.
      logOutputBuffer = new ArrayOutputStream();
      logicalOut = new FormatIdOutputStream(logOutputBuffer);

      /** initialize the buffer with space reserved for checksum log record in
       * the beginning of the log buffer; checksum record is written into
       * this space when buffer is switched
View Full Code Here

     *
     * @exception  StandardException  Standard exception policy.
     **/
    private void createOutStreams()
    {
        rawDataOut = new ArrayOutputStream();
        rawDataOut.setData(pageData);

        logicalDataOut = new FormatIdOutputStream(rawDataOut);
    }
View Full Code Here

  {
    if (SanityManager.DEBUG)
      SanityManager.ASSERT(a.length >= CONTAINER_INFO_SIZE,
                 "header won't fit in array");

    ArrayOutputStream a_out = new ArrayOutputStream(a);
    FormatIdOutputStream outStream = new FormatIdOutputStream(a_out);

    int status = 0;
    if (getDroppedState()) status |= FILE_DROPPED;
    if (getCommittedDropState()) status |= FILE_COMMITTED_DROP;
    if (isReusableRecordId()) status |= FILE_REUSABLE_RECORDID;

    a_out.setPosition(0);
    a_out.setLimit(CONTAINER_INFO_SIZE);
    outStream.writeInt(formatIdInteger);
    outStream.writeInt(status);
    outStream.writeInt(pageSize);
    outStream.writeInt(spareSpace);
    outStream.writeInt(minimumRecordSize);
    outStream.writeShort(initialPages);
    outStream.writeShort(PreAllocSize);    // write spare1
    outStream.writeLong(firstAllocPageNumber);
    outStream.writeLong(firstAllocPageOffset);
    outStream.writeLong(containerVersion);
    outStream.writeLong(estimatedRowCount);
    outStream.writeLong(reusableRecordIdSequenceNumber);
    outStream.writeLong(0);    //Write spare3

    checksum.reset();
    checksum.update(a, 0, CONTAINER_INFO_SIZE - CHECKSUM_SIZE);

    // write the checksum to the array
    outStream.writeLong(checksum.getValue());

    a_out.clearLimit();
  }
View Full Code Here

     *
     * @exception  StandardException  Standard exception policy.
     **/
    private void createOutStreams()
    {
        rawDataOut = new ArrayOutputStream();
        rawDataOut.setData(pageData);

        logicalDataOut = new FormatIdOutputStream(rawDataOut);
    }
View Full Code Here

  {
    if (SanityManager.DEBUG)
      SanityManager.ASSERT(a.length >= CONTAINER_INFO_SIZE,
                 "header won't fit in array");

    ArrayOutputStream a_out = new ArrayOutputStream(a);
    FormatIdOutputStream outStream = new FormatIdOutputStream(a_out);

    int status = 0;
    if (getDroppedState()) status |= FILE_DROPPED;
    if (getCommittedDropState()) status |= FILE_COMMITTED_DROP;
    if (isReusableRecordId()) status |= FILE_REUSABLE_RECORDID;

    a_out.setPosition(0);
    a_out.setLimit(CONTAINER_INFO_SIZE);
    outStream.writeInt(formatIdInteger);
    outStream.writeInt(status);
    outStream.writeInt(pageSize);
    outStream.writeInt(spareSpace);
    outStream.writeInt(minimumRecordSize);
    outStream.writeShort(initialPages);
    outStream.writeShort(PreAllocSize);    // write spare1
    outStream.writeLong(firstAllocPageNumber);
    outStream.writeLong(firstAllocPageOffset);
    outStream.writeLong(containerVersion);
    outStream.writeLong(estimatedRowCount);
    outStream.writeLong(0);    //Write spare2
    outStream.writeLong(0);    //Write spare3

    checksum.reset();
    checksum.update(a, 0, CONTAINER_INFO_SIZE - CHECKSUM_SIZE);

    // write the checksum to the array
    outStream.writeLong(checksum.getValue());

    a_out.clearLimit();
  }
View Full Code Here

     *
     * @exception  StandardException  Standard exception policy.
     **/
    private void createOutStreams()
    {
        rawDataOut = new ArrayOutputStream();
        rawDataOut.setData(pageData);

        logicalDataOut = new FormatIdOutputStream(rawDataOut);
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.services.io.ArrayOutputStream

Copyright © 2018 www.massapicom. 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.