package com.mindoo.ec09.legacy;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

import com.mindoo.ec09.framework.views.ViewData;

public class StringViewData implements ViewData {
	private String m_id=null;
	private String m_data;
	
	public StringViewData(String id, String data) {
		m_id=id;
		m_data=data;
	}
	
	public String getID() {
		return m_id;
	}

	public InputStream openStream() throws IOException {
		return new ByteArrayInputStream(m_data.toString().getBytes());
	}
	
	public String toString() {
		return (m_data!=null) ? m_data.toString() : "";
	}
}
