Package org.apache.activeio.util

Examples of org.apache.activeio.util.ByteArrayOutputStream


    public void store(String id, Object data) throws IOException {
        log.debug("Storing object with id: " + id);
        Connection connection = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutputStream out = new ObjectOutputStream(buffer);
            out.writeObject(data);
            out.close();
            connection = factory.getDataSource().getConnection();
            factory.getAdapter().doStoreData(connection, name + ":" + id, buffer.toByteArray());
        } catch (Exception e) {
            throw (IOException) new IOException("Error storing object").initCause(e);
        } finally {
            if (connection != null) {
                try {
View Full Code Here

TOP

Related Classes of org.apache.activeio.util.ByteArrayOutputStream

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.