public boolean readJPEGChannel(InputStream in, int c, int chanW, int chanH) throws java.io.IOException {
		int len=readInt(in);
		newjpegLen=len;
		//System.out.println("len="+len);
		if(!_isConnected) return false;
		if(len>=_newjpeg.length) {
			System.out.println("Not enough tmp room");
			return false;
		}
		readBytes(_newjpeg,in,len);
		if(!_isConnected) return false;
		if(len>chanW*chanH*channels) {
			if(!badCompressWarn) {
				badCompressWarn=true;
				System.out.println("Compressed image is larger than raw would be... :(");
			}
		} else {
			if(badCompressWarn) {
				badCompressWarn=false;
				System.out.println("...ok, compressed image is smaller than raw now... :)");
			}
		}

		try {
			ImageInputStream jpegStream=new MemoryCacheImageInputStream(new ByteArrayInputStream(_newjpeg));
			jpegReader.setInput(jpegStream); 
			Raster decoded=jpegReader.readRaster(0,null);
			int off=c;
			for(int y=0; y<chanH; y++)
				for(int x=0; x<chanW; x++) {
					_data[off]=(byte)decoded.getSample(x,y,0);
					off+=channels;
				}
		} catch(Exception e) { 
            System.out.println("Error reading from input stream: " + e);
        }
		return true;
	}