1 29 30 package com.caucho.vfs; 31 32 import java.io.IOException ; 33 import java.io.OutputStream ; 34 35 39 public class StreamImplOutputStream extends OutputStream { 40 private StreamImpl _stream; 41 private byte []_buf = new byte[1]; 42 43 public StreamImplOutputStream(StreamImpl stream) 44 { 45 _stream = stream; 46 } 47 48 53 public void write(int v) 54 throws IOException 55 { 56 _buf[0] = (byte) v; 57 58 _stream.write(_buf, 0, 1, false); 59 } 60 61 68 public void write(byte []buffer, int offset, int length) 69 throws IOException 70 { 71 _stream.write(buffer, offset, length, false); 72 } 73 74 77 public void flush() throws IOException 78 { 79 _stream.flush(); 80 } 81 82 85 public void close() throws IOException 86 { 87 _stream.close(); 88 } 89 } 90 | Popular Tags |