Package com.sleepycat.bdb.util

Examples of com.sleepycat.bdb.util.FastOutputStream


        char c = 0;
        byte[] buf = new byte[10];
        byte[] javaBuf = new byte[10];
        char[] cArray = new char[1];
        FastOutputStream javaBufStream = new FastOutputStream(javaBuf);
        DataOutputStream javaOutStream = new DataOutputStream(javaBufStream);

        try {
            for (int cInt = Character.MIN_VALUE; cInt <= Character.MAX_VALUE;
                 cInt += 1) {
                c = (char) cInt;
                cArray[0] = c;
                int byteLen = UtfOps.getByteLength(cArray);

                javaBufStream.reset();
                javaOutStream.writeUTF(new String(cArray));
                int javaByteLen = javaBufStream.size() - 2;

                if (byteLen != javaByteLen) {
                    fail("Character 0x" + Integer.toHexString(c) +
                         " UtfOps size " + byteLen +
                         " != JavaIO size " + javaByteLen);
View Full Code Here


    }

    void initSerialUnshared()
        throws Exception {

        fo = new FastOutputStream();
    }
View Full Code Here

    void initSerialShared()
        throws Exception {

        jtc = new TestClassCatalog();
        fo = new FastOutputStream();
    }
View Full Code Here

    void initXmlSax()
        throws Exception {

        buf = new byte[500];
        fo = new FastOutputStream();
        SAXParserFactory saxFactory = SAXParserFactory.newInstance();
        saxFactory.setNamespaceAware(true);
        parser = saxFactory.newSAXParser().getXMLReader();
    }
View Full Code Here

            throw new IllegalArgumentException(
                        "Data object class (" + object.getClass() +
                        ") not an instance of format's base class (" +
                        baseClass + ')');
        }
        FastOutputStream fo = new FastOutputStream();
        SerialOutput jos = new SerialOutput(fo, classCatalog);
        jos.writeObject(object);

        byte[] hdr = SerialOutput.getStreamHeader();
        data.setData(fo.getBufferBytes(), hdr.length,
                     fo.getBufferLength() - hdr.length);
        data.setDataFormation(object);
    }
View Full Code Here

TOP

Related Classes of com.sleepycat.bdb.util.FastOutputStream

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.