JavaSE学习笔记 2023-12-21 --流

十九、流

« 上一篇
个人整理非商业用途,欢迎探讨与指正!!


文章目录

    • 十九、流
      • 19.1流的概念
      • 19.2File类
        • 19.2.1File对象的创建
        • 19.2.2Java中的路径表示
        • 19.2.3File中的常用方法
        • 19.2.4FileNameFilter接口
      • 19.3IO流
        • 19.3.1流的划分
        • 19.3.2字节流[重点]
        • 19.3.3IO流使用时的细节
        • 19.3.4字节缓冲流
        • 19.3.5文件拷贝
        • 19.3.6对象流
        • 19.3.7数据流
        • 19.3.8字符流
        • 19.3.9字符缓冲流
        • 19.3.10打印流
        • 19.3.11转换流
        • 19.3.12Properties流操作
      • 19.4NIO


19.1流的概念

在程序中,数据是需要传输的,例如将磁盘上的数据显示到浏览器上,需要将数据进行传输
java中将数据传输的技术称为"流"

19.2File类

19.2.1File对象的创建

将系统中磁盘上的文件或者文件夹转换为java中的对象

public class Demo01 {public static void main(String[] args) {
//		将D盘下的IO文件夹创建为java对象
//		文件夹File file = new File("D:/IO");
//		判断是否存在的方法System.out.println(file.exists());//		文件file = new File("D:/IO/a.txt");System.out.println(file.exists());//		分割符可以使用 / 或者 \\(转义字符)file = new File("D:\\IO\\a.txt");System.out.println(file.exists());}
}
19.2.2Java中的路径表示

相对路径:
 相对于当前的项目或者工程位置
绝对路径:
 在磁盘上的位置

public class Demo02 {public static void main(String[] args) {
//		绝对路径File file = new File("D:/IO/a.txt");System.out.println(file.exists());//		相对路径
//		以/开头(\\) 表示当前项目的所在磁盘(省略了当前项目的所在磁盘)
//		我的项目在D盘: /省略了D:File file2 = new File("/IO/a.txt");System.out.println(file2.exists());file2 = new File("/02-tools");System.out.println(file2.exists());//		不以/开头 针对当前项目的根路径File file3 = new File("a.txt");System.out.println(file3.exists());//		创建IO/c.txt对象file3 = new File("IO/c.txt");//当前项目中的IO文件夹下的c.txt文件System.out.println(file3.exists());//		创建com.qf.test01.Demo02文件对象file3 = new File("src/com/qf/test01/Demo02.java");System.out.println(file3.exists());}
}
19.2.3File中的常用方法
public class Demo03 {
//	File的常用方法public static void main(String[] args) {File file = new File("IO/d.txt");//		创建一个文件try {
//			创建一个文件file.createNewFile();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}
}
public class Demo04 {//	创建文件夹(目录)
//	mkdir:创建一个目录,若父级目录不存在,则不创建(只能创建一层目录)
//	mkdirs:创建一个目录,若父级目录不存在,则会一起创建(可以创建多层目录)public static void main(String[] args) {File file = new File("java");
//		
//		file.mkdir();
//		file.mkdirs();file = new File("se/io");
//		file.mkdir();file.mkdirs();}
}
public class Demo05 {public static void main(String[] args) {
//		删除方法,删除文件或者空目录File file = new File("a.txt");file.delete();file = new File("IO");
//		非空目录无法删除file.delete();file = new File("java");
//		空的目录可以删除file.delete();file = new File("se");file.delete();
//		判断目录或者是文件是否存在System.out.println(file.exists());
//		获取文件或者文件夹的大小System.out.println(file.length());System.out.println(new File("b.txt").length());}
}
public class Demo06 {public static void main(String[] args) {File file = new File("IO/c.txt");//		绝对路径的String格式System.out.println(file.getAbsolutePath());
//		返回绝对路径 返回值是FileSystem.out.println(file.getAbsoluteFile());
//		获取文件(夹)的名字System.out.println(file.getName());
//		获取父目录System.out.println(file.getParent());
//		判断是否为目录System.out.println(file.isDirectory());
//		判断是否为文件System.out.println(file.isFile());file = new File("D:\\01-classin\\14-qf-jy-2305\\01-java\\03-课堂代码\\workspace_JAVASE\\20231221-25-JavaSE-IO流\\IO\\c.txt");
//		获取路径System.out.println(file.getPath());System.out.println("--------------------");
//		获取目录中的所有文件列表 查看D盘下的所有文件和目录file = new File("D:/");File[] listFiles = file.listFiles();for (File file2 : listFiles) {System.out.println(file2);}System.out.println("--------------------");
//		可以查看src下的所有内容file = new File("src/com/qf/test01");listFiles = file.listFiles();for (File file2 : listFiles) {System.out.println(file2);}}
}
19.2.4FileNameFilter接口

文件过滤器接口

public class Demo07 {public static void main(String[] args) {File file = new File("src/com/qf/test01");
//		对文件进行过滤
//		file.listFiles(new MyFilter());File[] listFiles = file.listFiles(new FilenameFilter() {
//			dir当前调用者 name具体的名字@Overridepublic boolean accept(File dir, String name) {
//				System.out.println(dir+","+name);
//				帮助我们得到想到的文件return name.startsWith("Test");}});for (File f : listFiles) {System.out.println(f);}}
}
class MyFilter implements FilenameFilter {@Overridepublic boolean accept(File dir, String name) {// TODO Auto-generated method stubreturn false;}
}

19.3IO流

文件是内存与存储设备之间的数据传输通道载体,需要借助流进行传输
所有的IO操作都会抛出IOException异常
所有的IO操作需要将资源关闭

19.3.1流的划分

按照方向划分:
 输出流:将内存中的内容写入到磁盘中(存进去)
 输入流:将存储设备中的内容读入到内存中(拿出来)
按照单位划分:
 字节流:以字节为单位,进行所有文件的读与写
 字符流:以字符为单位,只可以对文本数据进行读写(字符流是由字节流转换来的)
按照功能划分:
 节点流:具有实际数据传输功能的流(实现类)
 过滤流:在上述节点流的基础上进行功能的提升

19.3.2字节流[重点]

字节流:
 抽象类:
  InputStream:字节输入流
    读取内容
OutputStream:字节输出流
   写入内容
 子类:
  FileInputStream:文件字节输入流
  FileOutputStream:文件字节输出流

public class Demo01 {//	字节输出流public static void main(String[] args) throws IOException {
//		创建FileOutputStream对象,可以向参数中的File内去写内容
//		文件可以不存在,第一次写的时候FileOutputStream会创建一个文件
//		若文件存在,直接向对应的文件中写内容FileOutputStream fos = new FileOutputStream(new File("IO/hello.txt"));//		写入一个int数据
//		一次写入一个字符fos.write(97);fos.write(65);fos.write(90);fos.write(94);//		一次写入一个byte[]byte[] bs = {97,98,99,100,101};fos.write(bs);//		重载方法
//		指定的开始的位置,和长度fos.write(bs, 2, 3);System.out.println("写入成功!");
//		所有的流资源都需要关闭fos.close();}
}
public class Demo02 {public static void main(String[] args) throws IOException {
//		fos一共有四个构造方法
//		1.通过file创建fos对象
//		FileOutputStream fos = new FileOutputStream(new File("IO/hello.txt"));
//		2.通过文件名(String path)创建fos对象
//		FileOutputStream fos = new FileOutputStream("IO/hello.txt");
//		3.通过file和string都有一个append重载的构造方法 append的作用是内容的追加
//		FileOutputStream fos = new FileOutputStream("IO/hello.txt",true);FileOutputStream fos = new FileOutputStream(new File("IO/hello.txt"),true);fos.write(97);System.out.println("写入成功!");
//		所有的流资源都需要关闭fos.close();}
}
public class Demo03 {public static void main(String[] args) throws IOException {
//		读的文件必须是真实存在的FileInputStream fis = new FileInputStream("IO/hello.txt");//		读取内容 读取到结尾返回-1
//		一次读取一个字节int read = fis.read();/*System.out.println(read);read = fis.read();System.out.println(read);read = fis.read();System.out.println(read);read = fis.read();System.out.println(read);*/while(read != -1) {System.out.print((char)read);
//			再向下读取一次read = fis.read();}fis.close();}
}
public class Demo04 {public static void main(String[] args) throws IOException {
//		读的文件必须是真实存在的FileInputStream fis = new FileInputStream("IO/hello.txt");//		读取按照byte[]进行读取
//		从流中将内容存储到byte[]中
//		数组的大小是多少都是ok的,一般情况下每次读取文件的大小1kb~4kb(对于字节流读取文件的速度是最快的)byte[] bs = new byte[1024];//1kbSystem.out.println(Arrays.toString(bs));
//		返回值为文件内容的长度
//		int a = fis.read(bs);int a = fis.read(bs, 10, 10);//放到数组中的某个位置 off开始位置,len长度System.out.println(a);//		byte[]中是有值的System.out.println(Arrays.toString(bs));System.out.println(new String(bs,0,a));fis.close();}
}
19.3.3IO流使用时的细节

在使用输出流时,若文件不存在是会自动创建文件的(必须要保证父目录在),若存在自动想以存在的文件中添加内容
在写文件时,若想向追加内容(不是覆盖),可以使用输出流的重载构造,参数为append,默认为false,设置为true就是追加内容
在读取文件时,文件是必须真实存在,若不存在在抛出异常(FileNotFoundException)
在使用IO流时,无论读写,无论有没有发生异常都需要将流资源进行关闭,关闭资源代码写在finally中
将IO流的创建可以写在try()中,这个的IO流操作是自动关闭资源

public class Demo01 {public static void main(String[] args)  {
//		可以创建文件,不能创建文件夹FileOutputStream fos = null;try {fos = new FileOutputStream("IO/HelloWorld.java");} catch (FileNotFoundException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();} finally {try {
//				无论怎样都需要关闭if(fos != null) {fos.close();}} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}
}
public class Demo02 {public static void main(String[] args) {
//		可以将流资源放入到try()中,可以不关闭流,自动为我们关闭的try(FileOutputStream fos = new FileOutputStream("IO/HelloWorld.java");FileInputStream fis = new FileInputStream("IO/hello.txt");){}catch (Exception e) {// TODO: handle exception} finally {}}
}
19.3.4字节缓冲流

BufferedOutputStream/BufferedInputStream
提高IO效率,减少磁盘的访问次数
数据存储在缓冲区中,需要使用flush方法将内容写入文件,close同样有flush的效果

public class Demo01 {public static void main(String[] args) throws Exception {
//		节点流FileOutputStream fos = new FileOutputStream("IO/e.txt",true);
//		过滤流BufferedOutputStream bos = new BufferedOutputStream(fos);bos.write(97);bos.write("helloworld,你好".getBytes());System.out.println("写完了...");//		内容少,用close可以进行冲刷bos.flush();bos.close();fos.close();}
}public class Demo01 {public static void main(String[] args) throws Exception {
//		节点流FileOutputStream fos = new FileOutputStream("IO/e.txt",true);
//		过滤流BufferedOutputStream bos = new BufferedOutputStream(fos);bos.write(97);bos.write("helloworld,你好".getBytes());System.out.println("写完了...");//		内容少,用close可以进行冲刷bos.flush();bos.close();fos.close();}
}
19.3.5文件拷贝
public class Copy {public static void main(String[] args) throws IOException {copy1();}//	字节流拷贝 IO的次数非常多public static void copy() throws IOException {long start = System.currentTimeMillis();FileInputStream fis = new FileInputStream("D:/IO/ideaIU-2023.1.2.exe");FileOutputStream fos = new FileOutputStream("D:/IO/ideaIU-2023.1.2(1).exe");
//		4kb基本上就是一次拷贝的最大容量 在大的容量就没有速度上的明显提升了byte[] bs = new byte[1024*4];int len;while( (len = fis.read(bs)) != -1 ) {fos.write(bs,0,len);}long end = System.currentTimeMillis();fos.close();fis.close();System.out.println("拷贝时间:" + (end - start));}//	缓冲字节流拷贝 IO的次数明显较少public static void copy1() throws IOException {long start = System.currentTimeMillis();FileInputStream fis = new FileInputStream("D:/IO/ideaIU-2023.1.2.exe");FileOutputStream fos = new FileOutputStream("D:/IO/ideaIU-2023.1.2(1).exe");BufferedInputStream bis = new BufferedInputStream(fis);BufferedOutputStream bos = new BufferedOutputStream(fos);byte[] bs = new byte[1024*4];int len;while( (len = bis.read(bs)) != -1 ) {bos.write(bs,0,len);}long end = System.currentTimeMillis();bos.close();bis.close();fos.close();fis.close();System.out.println("拷贝时间:" + (end - start));}
}
19.3.6对象流

将对象在磁盘中的写入和读取
写入对象到磁盘中被称为序列化
将磁盘中的对象读取出来被称为反序列化

public class Demo01 {public static void main(String[] args) throws Exception {FileOutputStream fos = new FileOutputStream("IO/object.txt");
//		对象流ObjectOutputStream oos = new ObjectOutputStream(fos);//		写入文档中对象
//		基本数据类型oos.writeInt(100);oos.writeDouble(100.12);oos.writeUTF("对象流");oos.close();fos.close();System.out.println("------------------------");FileInputStream fis = new FileInputStream("IO/object.txt");ObjectInputStream ois = new ObjectInputStream(fis);System.out.println(ois.readInt());System.out.println(ois.readDouble());System.out.println(ois.readUTF());ois.close();fis.close();}
}

写入对象时,对应的类必须实现Seriablizable接口(可序列化接口)

public class Demo03 {public static void main(String[] args) throws Exception {FileOutputStream fos = new FileOutputStream("IO/object.txt");
//		对象流ObjectOutputStream oos = new ObjectOutputStream(fos);Dog dog = new Dog("小白", 1);oos.writeObject(dog);oos.close();fos.close();}
}
//	可以被序列化的类
class Dog implements Serializable{String name;
//	若int类型的age不想被序列化 transient int age;@Overridepublic String toString() {return "Dog [name=" + name + ", age=" + age + "]";}public Dog(String name, int age) {super();this.name = name;this.age = age;}
}
public class Demo04 {public static void main(String[] args) throws Exception {FileInputStream fis = new FileInputStream("IO/object.txt");ObjectInputStream ois = new ObjectInputStream(fis);Object object = ois.readObject();System.out.println(object);ois.close();fis.close();}
}
19.3.7数据流

DataInputStream/DataOutputStream
 也是过滤流,封装了对基本类型和String的读写

public class Demo01 {public static void main(String[] args) throws Exception {FileOutputStream fos = new FileOutputStream("IO/f.txt");DataOutputStream dos = new DataOutputStream(fos);dos.writeInt(100);dos.close();fos.close();FileInputStream fis = new FileInputStream("IO/f.txt");DataInputStream dis = new DataInputStream(fis);System.out.println(dis.readInt());dis.close();fis.close();}
}
19.3.8字符流

是由字节流转换来的
 抽象类:Reader Writer
 实现类:FileReader FileWriter
操作字符的

public class Demo01 {public static void main(String[] args) throws Exception {Reader reader = new FileReader("IO/hello.txt");int r = reader.read();System.out.println(r);r = reader.read();System.out.println(r);reader.close();}
}
public class Demo02 {public static void main(String[] args) throws IOException {FileWriter writer = new FileWriter("IO/hello.txt",true);//		直接写入一个字符串writer.write("HELLOWORLD");writer.close();}
}
19.3.9字符缓冲流

BufferedWriter/BufferedReader
支持读写一行的操作

public class Demo01 {public static void main(String[] args) throws Exception {FileReader fr = new FileReader("IO/hello.txt");BufferedReader br = new BufferedReader(fr);String readLine;while((readLine = br.readLine()) != null) {System.out.println(readLine);}br.close();fr.close();}
}
public class Demo02 {public static void main(String[] args) throws Exception {FileWriter fw = new FileWriter("IO/hello.txt",true);BufferedWriter bw = new BufferedWriter(fw);
//		直接写一个换行符bw.newLine();bw.write("21.上课你不听课,在那嘎达整头像,你整他有啥用");bw.close();fw.close();}
}
19.3.10打印流
public class Demo01 {public static void main(String[] args) throws IOException {PrintStream ps = new PrintStream("IO/g.txt");ps.print(10);ps.println();ps.println(10);ps.print(19.2);ps.print("哈哈哈");ps.close();PrintWriter pw = new PrintWriter("IO/h.txt");pw.print("哈哈哈");pw.close();}
}
19.3.11转换流

InputStreamReader:将字节输入流转换为字符输入流
OutputStreamWriter:将字节输出流转换为字符输入流

public class Demo01 {public static void main(String[] args) throws Exception {OutputStream os = new FileOutputStream("IO/z.txt");
//		从字节转换为字符OutputStreamWriter outputStreamWriter = new OutputStreamWriter(os);outputStreamWriter.write("HELLOWORLD");outputStreamWriter.close();os.close();}
}
19.3.12Properties流操作

操作属性文件
Properties是Hashtable的子类

username=tom
password=123456
hobby=\u5B66\u4E60
gender=\u7537
public class Demo01 {public static void main(String[] args) throws Exception {Properties p = new Properties();//		加载属性文件p.load(new FileInputStream("pro/db.properties"));
//		通过key获取valueObject value1 = p.get("username");System.out.println(value1);value1 = p.get("password");System.out.println(value1);value1 = p.get("hobby");System.out.println(value1);value1 = p.get("gender");System.out.println(value1);}
}

19.4NIO

New IO
 在JDK1.4后引入的读写机制,提高数据的读写效率

IO,面向流操作,以字节为单位进行读写(BIO)
NIO,面向缓冲区操作,以块为单位进行读写

public class Demo01 {public static void main(String[] args) throws Exception {copyFile("pro/db.properties","pro/db1.properties");}/*** * @param src	源路径* @param dest	目标路径* @throws IOException*/public static void copyFile(String src,String dest) throws IOException{
//		判断src是否存在,dest是否文件FileInputStream fis = new FileInputStream(src);//读源文件FileOutputStream fos = new FileOutputStream(dest);//写入到目标文件中//		获取管道FileChannel fileIn = fis.getChannel();//读取时的管道FileChannel fileOut = fos.getChannel();//写入时的管道//		申请缓冲区ByteBuffer buffer = ByteBuffer.allocate(1024);//字节缓冲区,类似于byte[] bs = new byte[1024];while( fileIn.read(buffer) != -1) {
//			类似于指针的工具,需要它在最前面buffer.flip();
//			写fileOut.write(buffer);
//			类似于flush操作buffer.clear();}//		关闭fileOut.close();fileIn.close();fos.close();fis.close();System.out.println("over");}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/582478.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

常用的 linux 命令

常用的 linux 命令 1.从其他机器拷贝文件夹2.查看哪个程序在用特定端口3.实时监控日志文件内容4.查看指定用户拥有的进程5.查看磁盘空间使用情况6.文件搜索which(whereis) 显示系统命令所在目录find 查找任何文件或目录1) 根据文件名称查找2)…

具身智能主流方法:模仿学习,和强化学习

1.区别 模仿学习:倾向于从优秀的个体展现出来的技能中快速学习,并获得泛化能力,但模仿学习目前学到的仅是相同技能的不用应用,比方说,“放苹果”泛化到“放梨”,“放牛奶”,都是“放”这个技能的…

磁盘——磁盘管理与文件系统

目录 一、在linux中使用硬盘分三步 1、分区 2、文件系统(管理大小权限。日志恢复) 3、挂载(硬盘和系统文件做关联,使用文件夹使用系统) 二、磁盘结构 三、MBR与GPT磁盘分区 1、分区的原因,为什么分区…

Ubuntu18.04安装GTSAM库并验证GTSAM是否安装成功(亲测可用)

在SLAM(Simultaneous Localization and Mapping)和SFM(Structure from Motion)这些复杂的估计问题中,因子图算法以其高效和灵活性而脱颖而出,成为图模型领域的核心技术。GTSAM(Georgia Tech Smo…

Java八股文面试全套真题【含答案】- RocketMQ篇

以下是关于Java八股文面试全套真题- RocketMQ篇 1.RocketMQ 是什么?它的特点和优势是什么? RocketMQ 是一个开源的分布式消息中间件系统,具有高吞吐量、低延迟、可靠性强等特点。 特点和优势: 高吞吐量:支持每秒百万级…

Mybatis 动态 SQL - foreach

动态SQL的另一个常见需求是需要迭代一个集合&#xff0c;通常用于构建IN条件。例如&#xff1a; <select id"selectPostIn" resultType"domain.blog.Post">SELECT *FROM POST P<where><foreach item"item" index"index&quo…

Vue 3 中安装并使用 Axios 详细步骤+样例代码详解

axios详细步骤 在集成终端打开&#xff0c;使用 npm 或 yarn 安装 Axios&#xff1a; npm install axios或 yarn add axios这将在您的项目中安装 Axios。 在您的 Vue 3 项目中创建一个用于发送 HTTP 请求的模块或文件&#xff0c;比如 http.js。 在 http.js 文件中导入 Axios…

K8s实战-init容器

概念&#xff1a; 初始化容器的概念 比如一个容器A依赖其他容器&#xff0c;可以为A设置多个 依赖容易A1&#xff0c;A2&#xff0c;A3 A1,A2,A3要按照顺序启动&#xff0c;A1没有启动启动起来的 话&#xff0c;A2,A3是不会启动的&#xff0c;直到所有的静态容器全 部启动完毕…

Java并发编程(四)

ThreadLocal 1.ThreadLocal是什么 ThreadLocal类让每一个线程都拥有了自己的本地变量&#xff0c;这意味着每个线程都可以独立地、安全地操作这些变量&#xff0c;而不会影响其他线程。 ThreadLocal的常用API get()&#xff1a;获取当前线程中与ThreadLocal对象关联的变量副…

Java EasyExcel 导入代码

Java EasyExcel 导入代码 导入方法 /*** 仓库库位导入** param req* param res* param files* throws Exception*/RequestMapping(value {"/import/line_store_locs"}, method {RequestMethod.POST})ResponseBodypublic void importStoreLoc(HttpServletRequest …

MySQL 索引、事务与存储引擎

MySQL 索引 索引的概念 索引是一个排序的列表&#xff0c;在这个列表中存储着索引的值和包含这个值的数据所在行的物理地址&#xff08;类似于C语言的链表通过指针指向数据记录的内存地址&#xff09;。使用索引后可以不用扫描全表来定位某行的数据&#xff0c;而是先通过索引…

一种适合企业的大体量数据迁移方式

在企业进行数字化转型的过程中&#xff0c;数据迁移是一项至关重要的任务。无论是从旧系统到新系统、从本地数据中心到云端&#xff0c;还是在不同云服务提供商之间进行数据迁移&#xff0c;数据的顺利转移对业务的成功至关重要。 然而&#xff0c;随着数据体量的不断增加&…

[SWPUCTF 2021 新生赛]sql

[SWPUCTF 2021 新生赛]sql wp 输入 1 正常回显&#xff1a; ?wllm1 返回&#xff1a; Want Me? Cross the Waf Your Login name:xxx Your Password:yyy输入单引号引发报错&#xff1a; ?wllm1 返回&#xff1a; Want Me? Cross the Waf You have an error in your SQL s…

ios环境搭建_xcode安装及运行源码

目录 1 xcode 介绍 2 xcode 下载 3 xocde 运行ios源码 1 xcode 介绍 Xcode 是运行在操作系统Mac OS X上的集成开发工具&#xff08;IDE&#xff09;&#xff0c;由Apple Inc开发。Xcode是开发 macOS 和 iOS 应用程序的最快捷的方式。Xcode 具有统一的用户界面设计&#xff0…

为什么IDEA建议去掉StringBuilder,而要使用“+”拼接字符串

在字符串拼接时应该都见过下面这种提示&#xff1a; 大家普遍认知中&#xff0c;字符串拼接要用StringBuilder&#xff0c;那为什么idea会建议你是用呢&#xff0c;那到底StringBuilder和有什么具体区别呢&#xff0c;我们一起来探究一下。 普通拼接 普通的几个字符串拼接成一…

0基础学习VR全景平台篇第132篇:曝光三要素—快门速度

上课&#xff01;全体起立~ 大家好&#xff0c;欢迎观看蛙色官方系列全景摄影课程&#xff01; 经过前面两节课的学习我们认识了曝光三要素中的感光度和光圈&#xff0c;这节课我们将一同去了解影响曝光的最后一个要素——快门速度。 (曝光三要素&#xff1a;感光度、光圈、…

YOLOv8算法优化:解决YOLOv8无法打印计算量(GFLOPs)的问题点

💡💡💡本文内容:解决YOLOv8无法打印计算量的问题点 💡💡💡本文提供:1)训练阶段自动打印计算量;2)提供离线打印计算量的代码; 1.计算量介绍 FLOPS:注意S是大写,是 “每秒所执行的浮点运算次数”(floating-point operations per second)的缩写。它常被用…

低信噪比环境下的语音端点检测

端点检测技术 是 语音信号处理 的关键技术之一为提高低信噪比环境下端点检测的准确率和稳健性&#xff0c;提出了一种非平稳噪声抑制和调制域谱减结合功率 归一化 倒谱距离的端点检测算法 1 端点检测 1-1 定义 定义&#xff1a;在 存在背景噪声 的情况下检测出 语音的起始点和…

2022年全球软件质量效能大会(QECon北京站2022)-核心PPT资料下载

一、峰会简介 当前&#xff0c;新一轮科技革命和产业变革正在重塑全球经济格局&#xff0c;以云计算为代表的新一代信息技术创新活跃&#xff0c;与实体经济深度融合&#xff0c;推动泛在连接、数据驱动、智能引领的数字经济新形式孕育而生。 新兴技术的出现给测试乃至整个软…

Vue(一):Vue 入门与 Vue 指令

Vue 01. Vue 快速上手 1.1 Vue 的基本概念 用于 构建用户界面 的 渐进性 框架 构建用户界面&#xff1a;基于数据去渲染用户看到的界面渐进式&#xff1a;不需要学习全部的语法就能完成一些功能&#xff0c;学习是循序渐进的框架&#xff1a;一套完整的项目解决方案&#x…