Package org.ofbiz.entity.util

Examples of org.ofbiz.entity.util.ByteWrapper


        return resp;
    }

    public static Map importAddressMatchMapCsv(DispatchContext dctx, Map context) {
        GenericDelegator delegator = dctx.getDelegator();
        ByteWrapper file = (ByteWrapper) context.get("uploadedFile");
        String csvFile = new String(file.getBytes());
        csvFile = csvFile.replaceAll("\\r", "");
        String[] records = csvFile.split("\\n");

        for (int i = 0; i < records.length; i++) {
            if (records[i] != null) {
View Full Code Here


    /** Sets a field with an array of bytes, wrapping them automatically for easy use.
     * @param name The field name to set
     * @param bytes The byte array to be wrapped and set
     */
    public void setBytes(String name, byte[] bytes) {
        this.set(name, new ByteWrapper(bytes));
    }
View Full Code Here

        Object value = get(name);
        if (value == null) {
            return null;
        }
        if (value instanceof ByteWrapper) {
            ByteWrapper wrapper = (ByteWrapper) value;
            return wrapper.getBytes();
        }
        if (value instanceof byte[]) {
            return (byte[]) value;
        }
        // uh-oh, this shouldn't happen...
View Full Code Here

TOP

Related Classes of org.ofbiz.entity.util.ByteWrapper

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.