X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2FresourceFiles%2FFilterCRWriter.java;fp=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2FresourceFiles%2FFilterCRWriter.java;h=2e966754d977cf9c1ce6c54d0eb6669a527df8d0;hp=0000000000000000000000000000000000000000;hb=1463e5c4bbbd37f7ff86abe25da59b3e39977cee;hpb=32db32b8c6f1f0feba6905c3c68579f6b5891821 diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/FilterCRWriter.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/FilterCRWriter.java new file mode 100644 index 000000000..2e966754d --- /dev/null +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/FilterCRWriter.java @@ -0,0 +1,47 @@ +package org.simantics.graph.compiler.internal.resourceFiles; + +import java.io.FilterWriter; +import java.io.IOException; +import java.io.Writer; + +public class FilterCRWriter extends FilterWriter { + + public FilterCRWriter(Writer out) { + super(out); + } + + @Override + public void write(int c) throws IOException { + if(c != '\r') + out.write(c); + } + + @Override + public void write(char[] cbuf, int off, int len) throws IOException { + int begin = 0; + for(int i=0;i begin) + write(cbuf, off+begin, i-begin); + begin = i+1; + } + } + if(len > begin) + write(cbuf, off+begin, len-begin); + } + + @Override + public void write(String str, int off, int len) throws IOException { + int begin = 0; + for(int i=0;i begin) + write(str, off+begin, i-begin); + begin = i+1; + } + } + if(len > begin) + write(str, off+begin, len-begin); + } + +}