JavaͼƬ´¦Àí
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.imageio.ImageIO;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
public class ImageUtil {
public static int ORIGINAL_BANK_IMAGE = 1;//Ôʼͼ
public static int THUMBNAIL_BANK_IMAGE = 2;//ËõÂÔͼ
/**
*
* @param src ½«ÒªÑ¹ËõµÄͼƬ
* @param destFileName ѹËõºóµÄÎļþÃû
* @param width ¸ß¶È
* @param height ¿í¶È
* @param quality ѹËõÇåÎú¶È ½¨ÒéΪ1.0
* @param percentage ÊÇ·ñµÈ±ÈѹËõ Èôtrue¿í¸ß±ÈÂʽ«½«×Ô¶¯µ÷Õû
* @return
*/
public static File compress(File src, String destFileName, int width, int height,
float quality, boolean percentage) {
try {
Image srcImage = ImageIO.read(src);
if (percentage) {
// ΪµÈ±ÈËõ·Å¼ÆËãÊä³öµÄͼƬ¿í¶È¼°¸ß¶È
double rate1 = ((double) srcImage.getWidth(null))
/ (double) width + 0.1;
&nbs
Ïà¹ØÎĵµ£º
ÎÒÃǶ¼ÖªµÀÒ»¸ö¶ÔÏóֻҪʵÏÖÁËSerilizable½Ó¿Ú£¬Õâ¸ö¶ÔÏó¾Í¿ÉÒÔ±»ÐòÁл¯£¬javaµÄÕâÖÖÐòÁл¯Ä£Ê½Îª¿ª·¢ÕßÌṩÁ˺ܶà±ãÀû£¬ÎÒÃÇ¿ÉÒÔ²»±Ø¹ØÏµ¾ßÌåÐòÁл¯µÄ¹ý³Ì£¬Ö»ÒªÕâ¸öÀàʵÏÖÁËSerilizable½Ó¿Ú£¬Õâ¸öµÄËùÓÐÊôÐԺͷ½·¨¶¼»á×Ô¶¯ÐòÁл¯¡£
È»¶øÔÚʵ¼Ê¿ª·¢¹ý³ÌÖУ¬ÎÒÃdz£³£»áÓöµ½ÕâÑ ......
´úÂë¿é£º¾ÍÊÇÓÃ{}À¨ÆðÀ´µ½²¿·Ö¡£¸ù¾ÝÓ¦ÓõIJ»Í¬·ÖΪ4Àà:ÆÕͨ´úÂë¿é¡¢¹¹Ôì¿é¡¢¾²Ì¬´úÂë¿é¡¢Í¬²½´úÂë¿é¡£
1.ÆÕͨ´úÂë¿é£º¶¨ÒåÔÚ·½·¨ÖеĴúÂë¿é¡£
È磺
public class Ex22 {
public static void main(String[] args){
// ÆÕͨ´úÂë¿é
{
int i = 3;
System ......
JAVA--java.io.InvalidClassException¼±½â
×ֺţºT|T
JAVA--java.io.InvalidClassException¼±½â
java.io.InvalidClassException: message.RegisterMessage; local class incompatible: stream classdesc serialVersionUID = 5540404719929042644, local class serialVersionUID = -8915824483106432775
»Ø´ð£º
×î¼Ñ ......
JAVAÕýÔò±í´ïʽ--PatternºÍMatcher
×÷Õߣº³Â¹ã¼Ñ ÎÄÕÂÀ´Ô´£ºwww.fooldock.com
·¢²¼ÈÕÆÚ£º2004Äê11ÔÂ19ÈÕ ä¯ÀÀ´ÎÊý£º2585´Î
ÏÖÔÚJDK1.4ÀïÖÕÓÚÓÐÁË×Ô¼ºµÄÕýÔò±í´ïʽAPI°ü£¬JAVA³ÌÐòÔ±¿ÉÒÔÃâÈ¥ÕÒµÚÈý·½ÌṩµÄÕýÔò±í´ïʽ¿âµÄÖÜÕÛÁË£¬ÎÒÃÇÏÖÔÚ¾ÍÂíÉÏÀ´Á˽âÒ»ÏÂÕâ¸öSUNÌṩµÄ³Ù ......
private void postMethod(String url) throws IOException
{
url = "http://www.newsmth.net/bbslogin2.php";
PostMethod postMethod = new PostMethod(url);
// ÌîÈë¸÷¸ö±íµ¥ÓòµÄÖµ
NameValuePair[] data = { new NameValuePair("id ......