1 28 29 package com.caucho.vfs; 30 31 import java.io.IOException ; 32 33 36 public class StdoutStream extends StreamImpl { 37 private static StdoutStream _stdout; 38 39 42 private StdoutStream() 43 { 44 } 45 46 49 public static StdoutStream create() 50 { 51 if (_stdout == null) { 52 _stdout = new StdoutStream(); 53 ConstPath path = new ConstPath(null, _stdout); 54 path.setScheme("stdout"); 55 _stdout.setPath(path); 56 } 57 58 return _stdout; 59 } 60 61 64 public boolean canWrite() 65 { 66 return true; 67 } 68 69 77 public void write(byte []buf, int offset, int length, boolean isEnd) 78 throws IOException 79 { 80 System.out.write(buf, offset, length); 81 System.out.flush(); 82 } 83 } 84 | Popular Tags |