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

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


    for (int slot = 0; slot < slotCount; slot++) {

      int recordLength = page.getRecordPortionLength(slot);


      CounterOutputStream counter = new CounterOutputStream();
      counter.setOutputStream(new NullOutputStream());

      int recordId =
                page.fetchFromSlot(
                    null,
                    slot,
                    new DataValueDescriptor[0],
                    (FetchDescriptor) null, true).getId();

      page.logRecord(slot, page.LOG_RECORD_DEFAULT, recordId,
               (FormatableBitSet) null, counter, (RecordHandle)null);

      int actualLength = counter.getCount();

      if (actualLength != recordLength) {
        out.println(
                    "CORRUPT PAGE: record length mismatch at slot " + slot);
        out.println("              slot entry length " + recordLength);
View Full Code Here


     * @param start start index (inclusive)
     * @param end end index (exclusive)
     */
    private int getUTF8Length(String string, int start, int end)
            throws StandardException {
        CounterOutputStream cs = new CounterOutputStream();

        try {
            FormatIdOutputStream out = new FormatIdOutputStream(cs);
            for (int i = start; i < end; i++) {
                writeUTF(out, string.charAt(i));
            }
            out.close();
        } catch (IOException ioe) {
            throw StandardException.newException(
                    SQLState.LANG_IO_EXCEPTION, ioe, ioe.toString());
        }

        return cs.getCount();
    }
View Full Code Here

     * @param start start index (inclusive)
     * @param end end index (exclusive)
     */
    private int getUTF8Length(String string, int start, int end)
            throws StandardException {
        CounterOutputStream cs = new CounterOutputStream();

        try {
            FormatIdOutputStream out = new FormatIdOutputStream(cs);
            for (int i = start; i < end; i++) {
                writeUTF(out, string.charAt(i));
            }
            out.close();
        } catch (IOException ioe) {
            throw StandardException.newException(
                    SQLState.LANG_IO_EXCEPTION, ioe, ioe.toString());
        }

        return cs.getCount();
    }
View Full Code Here

    for (int slot = 0; slot < slotCount; slot++) {

      int recordLength = page.getRecordPortionLength(slot);


      CounterOutputStream counter = new CounterOutputStream();
      counter.setOutputStream(new NullOutputStream());

      int recordId =
                page.fetchFromSlot(
                    null,
                    slot,
                    new DataValueDescriptor[0],
                    (FetchDescriptor) null, true).getId();

      page.logRecord(slot, page.LOG_RECORD_DEFAULT, recordId,
               (FormatableBitSet) null, counter, (RecordHandle)null);

      int actualLength = counter.getCount();

      if (actualLength != recordLength) {
        out.println(
                    "CORRUPT PAGE: record length mismatch at slot " + slot);
        out.println("              slot entry length " + recordLength);
View Full Code Here

    for (int slot = 0; slot < slotCount; slot++) {

      int recordLength = page.getRecordPortionLength(slot);


      CounterOutputStream counter = new CounterOutputStream();
      counter.setOutputStream(new NullOutputStream());

      int recordId =
                page.fetchFromSlot(
                    null,
                    slot,
                    new DataValueDescriptor[0],
                    (FetchDescriptor) null, true).getId();

      page.logRecord(slot, page.LOG_RECORD_DEFAULT, recordId,
               (FormatableBitSet) null, counter, (RecordHandle)null);

      int actualLength = counter.getCount();

      if (actualLength != recordLength) {
        out.println(
                    "CORRUPT PAGE: record length mismatch at slot " + slot);
        out.println("              slot entry length " + recordLength);
View Full Code Here

     * @param start start index (inclusive)
     * @param end end index (exclusive)
     */
    private int getUTF8Length(String string, int start, int end)
            throws StandardException {
        CounterOutputStream cs = new CounterOutputStream();

        try {
            FormatIdOutputStream out = new FormatIdOutputStream(cs);
            for (int i = start; i < end; i++) {
                writeUTF(out, string.charAt(i));
            }
            out.close();
        } catch (IOException ioe) {
            throw StandardException.newException(
                    SQLState.LANG_IO_EXCEPTION, ioe, ioe.toString());
        }

        return cs.getCount();
    }
View Full Code Here

    for (int slot = 0; slot < slotCount; slot++) {

      int recordLength = page.getRecordPortionLength(slot);


      CounterOutputStream counter = new CounterOutputStream();
      counter.setOutputStream(new NullOutputStream());

      int recordId =
                page.fetchFromSlot(
                    null,
                    slot,
                    new DataValueDescriptor[0],
                    (FetchDescriptor) null, true).getId();

      page.logRecord(slot, page.LOG_RECORD_DEFAULT, recordId,
               (FormatableBitSet) null, counter, (RecordHandle)null);

      int actualLength = counter.getCount();

      if (actualLength != recordLength) {
        out.println(
                    "CORRUPT PAGE: record length mismatch at slot " + slot);
        out.println("              slot entry length " + recordLength);
View Full Code Here

TOP

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

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.