当前位置: 首页>>代码示例>>Java>>正文


Java ORBUtility.isPrintable方法代码示例

本文整理汇总了Java中com.sun.corba.se.impl.orbutil.ORBUtility.isPrintable方法的典型用法代码示例。如果您正苦于以下问题:Java ORBUtility.isPrintable方法的具体用法?Java ORBUtility.isPrintable怎么用?Java ORBUtility.isPrintable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.corba.se.impl.orbutil.ORBUtility的用法示例。


在下文中一共展示了ORBUtility.isPrintable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printBuffer

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
void printBuffer() {
    byte[] buf = this.toByteArray();

    System.out.println("+++++++ Output Buffer ++++++++");
    System.out.println();
    System.out.println("Current position: " + buf.length);
    //System.out.println("Total length : " + buf.length);
    System.out.println();

    char[] charBuf = new char[16];

    try {

        for (int i = 0; i < buf.length; i += 16) {

            int j = 0;

            // For every 16 bytes, there is one line
            // of output.  First, the hex output of
            // the 16 bytes with each byte separated
            // by a space.
            while (j < 16 && j + i < buf.length) {
                int k = buf[i + j];
                if (k < 0)
                    k = 256 + k;
                String hex = Integer.toHexString(k);
                if (hex.length() == 1)
                    hex = "0" + hex;
                System.out.print(hex + " ");
                j++;
            }

            // Add any extra spaces to align the
            // text column in case we didn't end
            // at 16
            while (j < 16) {
                System.out.print("   ");
                j++;
            }

            // Now output the ASCII equivalents.  Non-ASCII
            // characters are shown as periods.
            int x = 0;

            while (x < 16 && x + i < buf.length) {
                if (ORBUtility.isPrintable((char)buf[i + x])) {
                    charBuf[x] = (char) buf[i + x];
                } else {
                    charBuf[x] = '.';
                }
                x++;
            }
            System.out.println(new String(charBuf, 0, x));
        }
    } catch (Throwable t) {
        t.printStackTrace();
    }
    System.out.println("++++++++++++++++++++++++++++++");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:60,代码来源:IDLJavaSerializationOutputStream.java

示例2: printBuffer

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public static void printBuffer(ByteBufferWithInfo bbwi) {

        System.out.println("+++++++ Output Buffer ++++++++");
        System.out.println();
        System.out.println("Current position: " + bbwi.position());
        System.out.println("Total length : " + bbwi.buflen);
        System.out.println();

        char[] charBuf = new char[16];

        try {

            for (int i = 0; i < bbwi.position(); i += 16) {

                int j = 0;

                // For every 16 bytes, there is one line
                // of output.  First, the hex output of
                // the 16 bytes with each byte separated
                // by a space.
                while (j < 16 && j + i < bbwi.position()) {
                    int k = bbwi.byteBuffer.get(i + j);
                    if (k < 0)
                        k = 256 + k;
                    String hex = Integer.toHexString(k);
                    if (hex.length() == 1)
                        hex = "0" + hex;
                    System.out.print(hex + " ");
                    j++;
                }

                // Add any extra spaces to align the
                // text column in case we didn't end
                // at 16
                while (j < 16) {
                    System.out.print("   ");
                    j++;
                }

                // Now output the ASCII equivalents.  Non-ASCII
                // characters are shown as periods.
                int x = 0;

                while (x < 16 && x + i < bbwi.position()) {
                    if (ORBUtility.isPrintable((char)bbwi.byteBuffer.get(i + x)))
                        charBuf[x] = (char)bbwi.byteBuffer.get(i + x);
                    else
                        charBuf[x] = '.';
                    x++;
                }
                System.out.println(new String(charBuf, 0, x));
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
        System.out.println("++++++++++++++++++++++++++++++");
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:58,代码来源:CDROutputStream_1_0.java

示例3: printBuffer

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
void printBuffer() {
    byte[] buf = this.buffer.array();

    System.out.println("+++++++ Input Buffer ++++++++");
    System.out.println();
    System.out.println("Current position: " + getPosition());
    System.out.println("Total length : " + this.bufSize);
    System.out.println();

    char[] charBuf = new char[16];

    try {

        for (int i = 0; i < buf.length; i += 16) {

            int j = 0;

            // For every 16 bytes, there is one line
            // of output.  First, the hex output of
            // the 16 bytes with each byte separated
            // by a space.
            while (j < 16 && j + i < buf.length) {
                int k = buf[i + j];
                if (k < 0)
                    k = 256 + k;
                String hex = Integer.toHexString(k);
                if (hex.length() == 1)
                    hex = "0" + hex;
                System.out.print(hex + " ");
                j++;
            }

            // Add any extra spaces to align the
            // text column in case we didn't end
            // at 16
            while (j < 16) {
                System.out.print("   ");
                j++;
            }

            // Now output the ASCII equivalents.  Non-ASCII
            // characters are shown as periods.
            int x = 0;

            while (x < 16 && x + i < buf.length) {
                if (ORBUtility.isPrintable((char)buf[i + x])) {
                    charBuf[x] = (char) buf[i + x];
                } else {
                    charBuf[x] = '.';
                }
                x++;
            }
            System.out.println(new String(charBuf, 0, x));
        }
    } catch (Throwable t) {
        t.printStackTrace();
    }
    System.out.println("++++++++++++++++++++++++++++++");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:60,代码来源:IDLJavaSerializationInputStream.java

示例4: printBuffer

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public static void printBuffer(ByteBufferWithInfo bbwi) {

        System.out.println("----- Input Buffer -----");
        System.out.println();
        System.out.println("Current position: " + bbwi.position());
        System.out.println("Total length : " + bbwi.buflen);
        System.out.println();

        try {

            char[] charBuf = new char[16];

            for (int i = 0; i < bbwi.buflen; i += 16) {

                int j = 0;

                // For every 16 bytes, there is one line
                // of output.  First, the hex output of
                // the 16 bytes with each byte separated
                // by a space.
                while (j < 16 && j + i < bbwi.buflen) {
                    int k = bbwi.byteBuffer.get(i + j);
                    if (k < 0)
                        k = 256 + k;
                    String hex = Integer.toHexString(k);
                    if (hex.length() == 1)
                        hex = "0" + hex;
                    System.out.print(hex + " ");
                    j++;
                }

                // Add any extra spaces to align the
                // text column in case we didn't end
                // at 16
                while (j < 16) {
                    System.out.print("   ");
                    j++;
                }

                // Now output the ASCII equivalents.  Non-ASCII
                // characters are shown as periods.
                int x = 0;
                while (x < 16 && x + i < bbwi.buflen) {
                    if (ORBUtility.isPrintable((char)bbwi.byteBuffer.get(i + x)))
                        charBuf[x] = (char)bbwi.byteBuffer.get(i + x);
                    else
                        charBuf[x] = '.';
                    x++;
                }
                System.out.println(new String(charBuf, 0, x));
            }

        } catch (Throwable t) {
            t.printStackTrace();
        }

        System.out.println("------------------------");
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:59,代码来源:CDRInputStream_1_0.java


注:本文中的com.sun.corba.se.impl.orbutil.ORBUtility.isPrintable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。