Package cli.System

Examples of cli.System.NotSupportedException


    public void produceImage() throws IOException, ImageFormatException{
        Stream stream = new Stream(){

            @Override
            public void Flush(){
                Util.throwException(new NotSupportedException());
            }

            @Override
            public int Read(byte[] bytes, int off, int len){
                try{
                    int count = input.read(bytes, off, len);
                    if( count < 0 ){
                        return 0;
                    }
                    return count;
                }catch(IOException ex){
                    throw new RuntimeException(ex);
                }
            }

            @Override
            public long Seek(long arg0, SeekOrigin arg1){
                Util.throwException(new NotSupportedException());
                return 0;
            }

            @Override
            public void SetLength(long arg0){
                Util.throwException(new NotSupportedException());
            }

            @Override
            public void Write(byte[] arg0, int arg1, int arg2){
                Util.throwException(new NotSupportedException());
            }

            @Override
            public boolean get_CanRead(){
                return true;
            }

            @Override
            public boolean get_CanSeek(){
                return false;
            }

            @Override
            public boolean get_CanWrite(){
                return true;
            }

            @Override
            public long get_Length(){
                try{
                    return input.available();
                }catch(IOException ex){
                    throw new RuntimeException(ex);
                }
            }

            @Override
            public long get_Position(){
                Util.throwException(new NotSupportedException());
                return 0;
            }

            @Override
            public void set_Position(long arg0){
                Util.throwException(new NotSupportedException());
            }
           
        };
        try{
            Bitmap bitmap = new Bitmap(stream);
View Full Code Here

TOP

Related Classes of cli.System.NotSupportedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.