zoukankan      html  css  js  c++  java
  • 文件上传

    1.SpringMVC文件上传配置,多文件上传,使用MultipartFile

    http://blog.csdn.net/swingpyzf/article/details/20230865

    2.java获取图片大小和尺寸

     1 import java.awt.image.BufferedImage;
     2 import java.io.File;
     3 import java.io.FileInputStream;
     4 import java.io.FileNotFoundException;
     5 import java.io.IOException;
     6 import javax.imageio.ImageIO;
     7 public class CalPit {
     8  public static void main(String[] args) throws FileNotFoundException, IOException {
     9   File picture = new File("D:/pic/neusoft.png");
    10   BufferedImage sourceImg =ImageIO.read(new FileInputStream(picture));
    11   System.out.println(String.format("%.1f",picture.length()/1024.0));
    12   System.out.println(sourceImg.getWidth());
    13   System.out.println(sourceImg.getHeight());
    14  }
    15 }

    http://blog.sina.com.cn/s/blog_67aaf4440101f7v6.html

    java获取文件大小

    今天写代码时需要实现获取文件大小的功能,目前有两种实现方法,一种是使用File的length()方法;另外一种是使用FileInputStream的available()方法,当InputStream未进行read操作时,available()的大小应该是等于文件大小的。但是在处理大文件时,后者会发生问题

    http://blog.csdn.net/chaijunkun/article/details/22387305

  • 相关阅读:
    7,MongoDB 之 Limit 选取 Skip 跳过 Sort 排序
    Python的while else
    linux route
    NCO
    rand和randn
    vi常用操作
    Linux常用命令
    Jmeter的NON-GUI模式
    Linux下安装jdk&Jmeter
    MySql安装完成后,Navicat连接不上的问题
  • 原文地址:https://www.cnblogs.com/hym-pcitc/p/6229828.html
Copyright © 2011-2022 走看看