java ѹËõͼƬ ʵÀý
public class ImageSizer {
public static final MediaTracker tracker = new MediaTracker(new Component() {
private static final long serialVersionUID = 1234162663955668507L;
});
/**
* ͼƬѹËõ
*
* @param originalFile ÔͼÏñ
* @param resizedFile ѹËõºóµÄͼÏñ
* @param width ͼÏñ¿í
* @param format ͼƬ¸ñʽ jpg, png, gif(·Ç¶¯»)
* @throws IOException
*/
public static void resize(File originalFile, File resizedFile, int width, String format) throws IOException {
if (format != null && "gif".equals(format.toLowerCase())) {
resize(originalFile, resizedFile, width, 1);
return;
}
FileInputStream fis = new FileInputStream(originalFile);
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
int readLength = -1;
int bufferSize = 1024;
byte bytes[] = new byte[bufferSize];
while ((readLength = fis.read(bytes, 0, bufferSize)) != -1) {
byteStream.write(bytes, 0, readLength);
}
byte[] in = byteStream.toByteArray();
fis.close();
byteStream.close();
Image inputImage = Toolkit.getDefaultToolkit().createImage(in);
waitForImage(inputImage);
int imageWidth = inputImage.getWidth(null);
if (imageWidth < 1) {
throw new IllegalArgumentException("image width " + imageWidth + " is out of range");
}
int imageHeight = inputImage.getHeight(null);
if (imageHeight < 1) {
throw new IllegalArgumentException("image height " + imageHeight + " is out of range");
}
// Create output image.
int height = -1;
double scaleW = (double) imageWidth / (double) width;
double scaleY = (double) imageHeight / (double) height;
if (scaleW >= 0 && s
Ïà¹ØÎĵµ£º
String ¶ÔÏóÊDz»¿É¸Ä±äµÄ¡£Ã¿´ÎʹÓà System.String ÀàÖеķ½·¨Ö®Ò»Ê±£¬¶¼ÒªÔÚÄÚ´æÖд´½¨Ò»¸öеÄ×Ö·û´®¶ÔÏó£¬Õâ¾ÍÐèҪΪ¸ÃжÔÏó·ÖÅäеĿռ䡣ÔÚÐèÒª¶Ô×Ö·û´®Ö´ÐÐÖØ¸´Ð޸ĵÄÇé¿öÏ£¬Óë´´½¨Ð嵀 String ¶ÔÏóÏà¹ØµÄϵͳ¿ªÏú¿ÉÄÜ»á·Ç³£°º¹ó¡£Èç¹ûÒªÐÞ¸Ä×Ö·û´®¶ø²»´´½¨ÐµĶÔÏó£¬Ôò¿ÉÒÔʹÓà System.Text.StringBuilder Àà¡£ÀýÈ ......
ÏÂÊöÊ®Ëĸö¼¼ÇÉ£¬ÊÇÐí¶àÈËÔÚ´óÁ¿µÄÊý¾Ý¿â·ÖÎöÓëÉè¼ÆÊµ¼ùÖУ¬Öð²½×ܽá³öÀ´µÄ¡£¶ÔÓÚÕâЩ¾ÑéµÄÔËÓ㬶ÁÕß²»ÄÜÉú°ïÓ²Ì×£¬ËÀ¼ÇÓ²±³£¬¶øÒªÏû»¯Àí½â£¬ÊµÊÂÇóÊÇ£¬Áé»îÕÆÎÕ¡£²¢Öð²½×öµ½£ºÔÚÓ¦ÓÃÖз¢Õ¹£¬ÔÚ·¢Õ¹ÖÐÓ¦Óá£
1. Ôʼµ¥¾ÝÓëʵÌåÖ®¼äµÄ¹ØÏµ
¡¡¡¡
  ......
×÷ΪJava³ÌÐòÔ±À´Ëµ£¬×îÍ´¿àµÄÊÂÇéιýÓÚ¿ÉÒÔÑ¡ÔñµÄ·¶Î§Ì«¹ã£¬¿ÉÒÔ¶ÁµÄÊéÌ«¶à£¬ÍùÍùÈÝÒ×ÎÞËùÊÊ´Ó¡£¸ù¾ÝÎҵľÑ飬°´ÕÕѧϰµÄÏȺó˳Ðò£¬ÍƼö¸ø´ó¼Ò£¬ÌرðÊÇÄÇЩÏë²»¶ÏÌá¸ß×Ô¼º¼¼ÊõˮƽµÄJava³ÌÐòÔ±ÃÇ¡£
Ò»¡¢Java±à³ÌÈëÃÅÀà
¶ÔÓÚûÓÐJava±à³Ì¾ÑéµÄ³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶Á ......
ÓÐÈçÏÂÇé¿öÏ¿ÉÒÔÓõ½ÄÚ´æÎļþÓ³Éä¼¼Êõ½â¾öÎÊÌâ:
1.²»Òª¸´ÖÆÎļþÖÐËùÓеÄÊý¾Ý£¬Ö»ÐèÒªÐÞ¸ÄÎļþÖоֲ¿µÄÊý¾Ý¡£
2.²¢ÐÐ\·Ö¶Î´¦Àí´óÎļþ¡£
ÈçÏ´úÂëʾʹÓÃjavaNIO¾Ö²¿ÐÞ¸ÄÎļþÖÐÖ¸¶¨Î»ÖõIJ¿·ÖÊý¾Ý£º
Java´úÂë
/**
* ÐÞ¸ÄÎļþÖеÄijһ²¿·ÖµÄÊý¾ ......
´úÂëÄÚÈÝ
create or replace procedure batchUpdateCustomer(p_age in number) as
begin
update CUSTOMERS set AGE=AGE+1 where AGE>p_age;
end;
ÒÔÉÏ´æ´¢¹ý³ÌÓÐÒ»¸ö²ÎÊýp_age£¬´ú±í¿Í»§µÄÄêÁ䣬ӦÓóÌÐò¿É°´ÕÕÒÔÏ·½Ê½µ÷Óô洢¹ý³Ì£º
´úÂëÄÚÈÝ
tx = session.beginTransaction();
Connection con=session.c ......