我在java中实现了管道和过滤器架构,我在我的FilterWriter
类我希望通过java发送对象的场景中遇到了FilterReader
{{ 3}},另一方面drill_function <- "#! function() {
var drilldown = this.drilldown;
function setChart(name, categories, data, color) {
chart.xAxis[0].setCategories(categories, false);
chart.series[0].remove(false);
chart.addSeries({
name: name,
data: data,
color: color
}, false);
chart.redraw();
};
if (drilldown) { // drill down
setChart(drilldown.name, drilldown.categories, drilldown.data);
} else { // restore
location.reload(); // <- this one reloads the page!
//setChart(name, categories, data, );
}
} !#"
类(PipedWriter)将读取此对象并从中提取信息。但看起来这些类只能编写以下类型:
我可以通过这些读者课程发送和接收对象吗? 在Pipe Filter架构中通过流发送对象的另一种合适方式是什么?
我想做PipedReader之类的事情,但我想写和读取对象而不是字符串或字节..我该怎么做?
答案 0 :(得分:0)
要编写Java对象(Serializables),您需要使用PipedOutputStream而不是PipedWriter
ObjectOutputStream oos = new ObjectOutputStream(new PipedOutputStream(sink));