All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mule.mvel2.templates.util.io.StandardOutputStream Maven / Gradle / Ivy

Go to download

MVEL is a powerful expression language for Java-based applications. It provides a plethora of features and is suited for everything from the smallest property binding and extraction, to full blown scripts.

There is a newer version: 2.1.9-MULE-019
Show newest version
package org.mule.mvel2.templates.util.io;

import org.mule.mvel2.templates.util.TemplateOutputStream;

import java.io.IOException;
import java.io.OutputStream;

public class StandardOutputStream implements TemplateOutputStream {
  private OutputStream outputStream;

  public StandardOutputStream(OutputStream outputStream) {
    this.outputStream = outputStream;
  }

  public TemplateOutputStream append(CharSequence c) {
    try {
      for (int i = 0; i < c.length(); i++) {
        outputStream.write(c.charAt(i));
      }

      return this;
    }
    catch (IOException e) {
      throw new RuntimeException("failed to write to stream", e);
    }
  }

  public TemplateOutputStream append(char[] c) {
    try {

      for (char i : c) {
        outputStream.write(i);
      }
      return this;
    }
    catch (IOException e) {
      throw new RuntimeException("failed to write to stream", e);
    }
  }

  @Override
  public String toString() {
    return null;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy