Package org.apache.isis.core.commons.encoding

Examples of org.apache.isis.core.commons.encoding.DataOutputStreamExtended


    }


    private static byte[] toBytes(final Memento memento) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStreamExtended output = new DataOutputStreamExtended(baos);
        memento.encodedData(output);
        return baos.toByteArray();
    }
View Full Code Here


    @Override
    public void connect() throws IOException {
        super.connect();

        this.input = new DataInputStreamExtended(getTransport().getInputStream());
        this.output = new DataOutputStreamExtended(getTransport().getOutputStream());

        if (debugging) {
            this.input = new DebugDataInputExtended(input);
            this.output = new DebugDataOutputExtended(output);
        }
View Full Code Here

            xml.append("      </services>\n");
            xml.append("      <objects>\n");
            for (final Object object : perspective.getObjects()) {
                final ObjectAdapter adapter = getPersistenceSession().getAdapterManager().adapterFor(object);
                final OutputStream out = new ByteArrayOutputStream();
                final DataOutputStreamExtended outputImpl = new DataOutputStreamExtended(out);
                adapter.getOid().encode(outputImpl);
                // FIX need to sort out encoding
                // xml.append("      <object>" + out.toString() +
                // "</object>\n");
                xml.append("        <object>" + "not yet encoding properly" + "</object>\n");
View Full Code Here

        mockery.assertIsSatisfied();
    }

    @Test
    public void testEncode() throws Exception {
        final DataOutputStreamExtended mockOutputImpl = mockery.mock(DataOutputStreamExtended.class);

        mockery.checking(new Expectations() {
            {
                one(mockOutputImpl).writeEncodable(with(any(ObjectData.class)));
                // one(mockOutputImpl).writeUTF(TestObject.class.getName());
View Full Code Here

    }

    @Ignore("currently failing - is no longer calling  isTransient on element #1 and element #2")
    @Test
    public void testData() throws Exception {
        final DataOutputStreamExtended mockOutputImpl = mockery.mock(DataOutputStreamExtended.class);

        final Oid oid1 = element1.getOid();
        final Oid oid2 = element1.getOid();

        mockery.checking(new Expectations() {
View Full Code Here

public class OidStringifierHex implements OidStringifier {

    @Override
    public String enString(final Oid oid) {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final DataOutputStreamExtended outputImpl = new DataOutputStreamExtended(baos);
        try {
            outputImpl.writeEncodable(oid);
            final byte[] byteArray = baos.toByteArray();
            return new String(Hex.encodeHex(byteArray));
        } catch (final IOException e) {
            throw new IsisException("Failed to write object", e);
        }
View Full Code Here

            xml.append("      </services>\n");
            xml.append("      <objects>\n");
            for (final Object object : perspective.getObjects()) {
                final ObjectAdapter adapter = getPersistenceSession().getAdapterManager().adapterFor(object);
                final OutputStream out = new ByteArrayOutputStream();
                final DataOutputStreamExtended outputImpl = new DataOutputStreamExtended(out);
                adapter.getOid().encode(outputImpl);
                // FIX need to sort out encoding
                // xml.append("      <object>" + out.toString() + "</object>\n");
                xml.append("        <object>" + "not yet encoding properly" + "</object>\n");
            }
View Full Code Here

    @Override
    public void connect() throws IOException {
        super.connect();

        this.input = new DataInputStreamExtended(getTransport().getInputStream());
        this.output = new DataOutputStreamExtended(getTransport().getOutputStream());

        if (debugging) {
            this.input = new DebugDataInputExtended(input);
            this.output = new DebugDataOutputExtended(output);
        }
View Full Code Here

        mockery.assertIsSatisfied();
    }

    @Test
    public void testEncode() throws Exception {
        final DataOutputStreamExtended mockOutputImpl = mockery.mock(DataOutputStreamExtended.class);

        mockery.checking(new Expectations() {
            {
                one(mockOutputImpl).writeEncodable(with(any(ObjectData.class)));
                // one(mockOutputImpl).writeUTF(TestObject.class.getName());
View Full Code Here

    }

    @Ignore("currently failing - is no longer calling  isTransient on element #1 and element #2")
    @Test
    public void testData() throws Exception {
        final DataOutputStreamExtended mockOutputImpl = mockery.mock(DataOutputStreamExtended.class);

        final Oid oid1 = element1.getOid();
        final Oid oid2 = element1.getOid();

        mockery.checking(new Expectations() {
View Full Code Here

TOP

Related Classes of org.apache.isis.core.commons.encoding.DataOutputStreamExtended

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.