Examples of CounterOutputStream


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

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

     * @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

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

     * @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

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

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

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

     * @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

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

Examples of org.apache.jmeter.protocol.smtp.sampler.tools.CounterOutputStream

            instance.setHeaderFields((CollectionProperty)getProperty(SmtpSampler.HEADER_FIELDS));
            message = instance.prepareMessage();

            if (getPropertyAsBoolean(MESSAGE_SIZE_STATS)) {
                // calculate message size
                CounterOutputStream cs = new CounterOutputStream();
                message.writeTo(cs);
                res.setBytes(cs.getCount());
            } else {
                res.setBytes(-1);
            }

        } catch (Exception ex) {
View Full Code Here

Examples of org.apache.jmeter.protocol.smtp.sampler.tools.CounterOutputStream

            instance.setHeaderFields((CollectionProperty)getProperty(SmtpSampler.HEADER_FIELDS));
            message = instance.prepareMessage();

            if (getPropertyAsBoolean(MESSAGE_SIZE_STATS)) {
                // calculate message size
                CounterOutputStream cs = new CounterOutputStream();
                message.writeTo(cs);
                res.setBytes(cs.getCount());
            } else {
                res.setBytes(-1);
            }

        } catch (Exception ex) {
View Full Code Here

Examples of org.apache.jmeter.protocol.smtp.sampler.tools.CounterOutputStream

            instance.setHeaderFields((CollectionProperty)getProperty(SmtpSampler.HEADER_FIELDS));
            message = instance.prepareMessage();

            if (getPropertyAsBoolean(MESSAGE_SIZE_STATS)) {
                // calculate message size
                CounterOutputStream cs = new CounterOutputStream();
                message.writeTo(cs);
                res.setBytes(cs.getCount());
            } else {
                res.setBytes(-1);
            }

        } catch (AddressException ex) {
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.