Package org.camunda.spin.spi

Examples of org.camunda.spin.spi.DataFormatReader


    }
  }

  protected Object deserializeFromByteArray(byte[] bytes, String objectTypeName) throws Exception {
    DataFormatMapper mapper = dataFormat.getMapper();
    DataFormatReader reader = dataFormat.getReader();

    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
    InputStreamReader inReader = new InputStreamReader(bais, Context.getProcessEngineConfiguration().getDefaultCharset());
    BufferedReader bufferedReader = new BufferedReader(inReader);

    try {
      Object mappedObject = reader.readInput(bufferedReader);
      return mapper.mapInternalToJava(mappedObject, objectTypeName);
    }
    finally{
      IoUtil.closeSilently(bais);
      IoUtil.closeSilently(inReader);
View Full Code Here


  }

  public <T extends Spin<?>> T createSpinFromStream(InputStream parameter, DataFormat<T> format) {
    ensureNotNull("parameter", parameter);

    DataFormatReader reader = format.getReader();
    Object dataFormatInput = reader.readInput(parameter);
    return format.createWrapperInstance(dataFormatInput);
  }
View Full Code Here

TOP

Related Classes of org.camunda.spin.spi.DataFormatReader

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.