001    package com.imagero.uio;
002    
003    import java.io.DataOutput;
004    import java.io.IOException;
005    
006    public class FilterDataOutput implements DataOutput {
007        /**
008         * The underlying output to be filtered.
009         */
010        protected DataOutput out;
011    
012        public FilterDataOutput(DataOutput out) {
013            this.out = out;
014        }
015    
016        public void write(int b) throws IOException {
017            out.write(b);
018        }
019    
020        public void write(byte b[]) throws IOException {
021            write(b, 0, b.length);
022        }
023    
024        public void write(byte b[], int off, int len) throws IOException {
025            if ((off | len | (b.length - (len + off)) | (off + len)) < 0)
026                throw new IndexOutOfBoundsException();
027    
028            for (int i = 0; i < len; i++) {
029                write(b[off + i]);
030            }
031        }
032    
033        public void writeBoolean(boolean v) throws IOException {
034            out.writeBoolean(v);
035        }
036    
037        public void writeByte(int v) throws IOException {
038            out.writeByte(v);
039        }
040    
041        public void writeShort(int v) throws IOException {
042            out.writeShort(v);
043        }
044    
045        public void writeChar(int v) throws IOException {
046            out.writeChar(v);
047        }
048    
049        public void writeInt(int v) throws IOException {
050            out.writeInt(v);
051        }
052    
053        public void writeLong(long v) throws IOException {
054            out.writeLong(v);
055        }
056    
057        public void writeFloat(float v) throws IOException {
058            out.writeFloat(v);
059        }
060    
061        public void writeDouble(double v) throws IOException {
062            out.writeDouble(v);
063        }
064    
065        public void writeBytes(String s) throws IOException {
066            out.writeBytes(s);
067        }
068    
069        public void writeChars(String s) throws IOException {
070            out.writeChars(s);
071        }
072    
073        public void writeUTF(String str) throws IOException {
074            out.writeUTF(str);
075        }
076    }