001    package fi.iki.hsivonen.io;
002    
003    import java.io.IOException;
004    import java.io.InputStream;
005    
006    /**
007     * @version $Id: AutobufferingBoundedInputStream.java,v 1.1 2005/05/07 11:09:35 hsivonen Exp $
008     * @author hsivonen
009     */
010    public final class AutobufferingBoundedInputStream extends InputStream {
011        
012        private byte[] buf;
013        
014        private volatile int end = 0;
015        
016        private int pos = 0;
017        
018        private int mark = 0;
019        
020        private volatile boolean full = false;
021        
022        private volatile boolean closed = false;
023        
024        private Object monitor = new Object();
025        
026        /**
027         * 
028         */
029        public AutobufferingBoundedInputStream() {
030            super();
031            // TODO Auto-generated constructor stub
032        }
033    
034        /**
035         * @see java.io.InputStream#read()
036         */
037        public int read() throws IOException {
038            // TODO Auto-generated method stub
039            return 0;
040        }
041    
042        /**
043         * @see java.io.InputStream#available()
044         */
045        public int available() throws IOException {
046            // TODO Auto-generated method stub
047            return super.available();
048        }
049        /**
050         * @see java.io.InputStream#close()
051         */
052        public void close() throws IOException {
053            // TODO Auto-generated method stub
054            super.close();
055        }
056        /**
057         * @see java.io.InputStream#mark(int)
058         */
059        public void mark(int arg0) {
060            mark = pos;
061        }
062        /**
063         * @see java.io.InputStream#markSupported()
064         */
065        public boolean markSupported() {
066            return true;
067        }
068        /**
069         * @see java.io.InputStream#read(byte[], int, int)
070         */
071        public int read(byte[] arg0, int arg1, int arg2) throws IOException {
072            // TODO Auto-generated method stub
073            return super.read(arg0, arg1, arg2);
074        }
075        /**
076         * @see java.io.InputStream#reset()
077         */
078        public void reset() throws IOException {
079            pos = mark;
080        }
081        /**
082         * @see java.io.InputStream#skip(long)
083         */
084        public long skip(long arg0) throws IOException {
085            // TODO Auto-generated method stub
086            return super.skip(arg0);
087        }
088    }