Package org.jbpm.bytes

Examples of org.jbpm.bytes.ByteArray


  public boolean supports(Object value) {
    return value instanceof byte[];
  }

  public ByteArray convert(byte[] o) {
    return new ByteArray(o);
  }
View Full Code Here


      bytes = memoryStream.toByteArray();
    }
    catch (IOException e) {
      throw new JbpmException("could not serialize: " + o, e);
    }
    return new ByteArray(bytes);
  }
View Full Code Here

      processFiles = new HashMap();
    }
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    log.trace("preparing file '" + name + "' for storage in the database");
    IoUtil.transfer(is, baos);
    processFiles.put(name, new ByteArray(name, baos.toByteArray()));
  }
View Full Code Here

  }

  private InputStream getInputStreamFromDb(String name) {
    InputStream inputStream = null;
    log.trace("loading file '" + name + "' from database");
    ByteArray byteArray = getByteArray(name);
    if (byteArray != null) {
      inputStream = new ByteArrayInputStream(byteArray.getBytes());
    }
    return inputStream;
  }
View Full Code Here

    return bytes;
  }

  byte[] getBytesFromDb(String name) {
    byte[] bytes;
    ByteArray byteArray = getByteArray(name);
    bytes = byteArray.getBytes();
    return bytes;
  }
View Full Code Here

    if (value==null) return true;
    return (value.getClass()==byte[].class);
  }

  public Object convert(Object o) {
    return new ByteArray((byte[]) o);
  }
View Full Code Here

      bytes = baos.toByteArray();
    } catch (IOException e) {
      throw new JbpmException("couldn't serialize '"+o+"'", e);
    }
   
    return new ByteArray(bytes);
  }
View Full Code Here

   
    return new ByteArray(bytes);
  }

  public Object revert(Object o) {
    ByteArray byteArray = (ByteArray) o;
    try {
      ByteArrayInputStream bais = new ByteArrayInputStream(byteArray.getBytes());
      ObjectInputStream ois = new ObjectInputStream(bais);
      return ois.readObject();
    } catch (Exception e) {
      throw new JbpmException("couldn't deserialize object", e);
    }
View Full Code Here

  public ByteArrayUpdateLog() {
  }

  public ByteArrayUpdateLog(VariableInstance variableInstance, ByteArray oldValue, ByteArray newValue) {
    super(variableInstance);
    this.oldValue = (oldValue!=null ? new ByteArray(oldValue) : null );
    this.newValue = (newValue!=null ? new ByteArray(newValue) : null );
  }
View Full Code Here

      processFiles = new HashMap();
    }
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    log.trace("preparing file '" + name + "' for storage in the database");
    IoUtil.transfer(is, baos);
    processFiles.put(name, new ByteArray(name, baos.toByteArray()));
  }
View Full Code Here

TOP

Related Classes of org.jbpm.bytes.ByteArray

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.