1 9 10 package org.jboss.util.stream; 11 12 import java.io.IOException ; 13 import java.io.ObjectOutputStream ; 14 15 import org.jboss.util.NullArgumentException; 16 17 26 public abstract class ObjectOutputStreamAdapter 27 extends ObjectOutputStream 28 { 29 30 protected ObjectOutputStream out; 31 32 41 public ObjectOutputStreamAdapter(ObjectOutputStream out) 42 throws IOException 43 { 44 super(); 46 if (out == null) 47 throw new NullArgumentException("out"); 48 49 this.out = out; 50 } 51 52 protected void writeObjectOverride(Object obj) throws IOException { 53 out.writeObject(obj); 54 } 55 56 public void useProtocolVersion(int version) throws IOException { 57 out.useProtocolVersion(version); 58 } 59 60 public void defaultWriteObject() throws IOException { 61 out.defaultWriteObject(); 62 } 63 64 public ObjectOutputStream.PutField putFields() throws IOException { 65 return out.putFields(); 66 } 67 68 public void writeFields() throws IOException { 69 out.writeFields(); 70 } 71 72 public void reset() throws IOException { 73 out.reset(); 74 } 75 76 public void write(int data) throws IOException { 77 out.write(data); 78 } 79 80 public void write(byte b[]) throws IOException { 81 out.write(b); 82 } 83 84 public void write(byte b[], int off, int len) throws IOException { 85 out.write(b, off, len); 86 } 87 88 public void flush() throws IOException { 89 out.flush(); 90 } 91 92 public void close() throws IOException { 93 out.close(); 94 } 95 96 public void writeBoolean(boolean data) throws IOException { 97 out.writeBoolean(data); 98 } 99 100 public void writeByte(int data) throws IOException { 101 out.writeByte(data); 102 } 103 104 public void writeShort(int data) throws IOException { 105 out.writeShort(data); 106 } 107 108 public void writeChar(int data) throws IOException { 109 out.writeChar(data); 110 } 111 112 public void writeInt(int data) throws IOException { 113 out.writeInt(data); 114 } 115 116 public void writeLong(long data) throws IOException { 117 out.writeLong(data); 118 } 119 120 public void writeFloat(float data) throws IOException { 121 out.writeFloat(data); 122 } 123 124 public void writeDouble(double data) throws IOException { 125 out.writeDouble(data); 126 } 127 128 public void writeBytes(String data) throws IOException { 129 out.writeBytes(data); 130 } 131 132 public void writeChars(String data) throws IOException { 133 out.writeChars(data); 134 } 135 136 public void writeUTF(String s) throws IOException { 137 out.writeUTF(s); 138 } 139 } 140 | Popular Tags |