1 19 20 package com.maverick.util; 21 22 import java.io.OutputStream ; 23 import java.io.IOException ; 24 25 class EOLProcessorOutputStream extends OutputStream { 26 27 EOLProcessor processor; 28 public EOLProcessorOutputStream(int inputStyle, 29 int outputStyle, 30 OutputStream out) 31 throws IOException { 32 processor = new EOLProcessor(inputStyle, outputStyle, out); 33 } 34 35 public void write(byte[] buf, int off, int len) throws IOException { 36 processor.processBytes(buf, off, len); 37 } 38 39 public void write(int b) throws IOException { 40 processor.processBytes(new byte[] { (byte)b }, 0, 1); 41 } 42 43 public void close() throws IOException { 44 processor.close(); 45 } 46 47 } 48 | Popular Tags |