当前位置: 首页 > news >正文

企业的网站建设怎么记科目重庆高端seo

企业的网站建设怎么记科目,重庆高端seo,开发app的过程,网站背景Java中的流,可以从不同的角度进行分类。 按照数据流的方向不同可以分为:输入流和输出流。 按照处理数据单位不同可以分为:字节流和字符流。 可以用下面的图来描述下: 字节流中的输入流的一些应用:代码如下&#…

Java中的流,可以从不同的角度进行分类。

按照数据流的方向不同可以分为:输入流和输出流。

按照处理数据单位不同可以分为:字节流和字符流。
可以用下面的图来描述下:
这里写图片描述

字节流中的输入流的一些应用:代码如下:


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;public class FileInputStreamTest {public static void main(String[] args) throws Exception{//找到目标文件File file=new File("d:/shareming/22.txt");// 建立数据输出通道FileInputStream is=new FileInputStream("d:/shareming/22.txt");//读取文件的方式byte[] buffer=new byte[5];int length=0;while(-1!=(length=is.read(buffer))){String result=new String(buffer,0,length);System.out.println(result);}is.close();}}

字节流中的输出流的一些应用(打印乘法表)+异常处理:代码如下:


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;public class FileOutputStreamTest {public static void main(String[] args) {// 找到目标文件File file = new File("d:/shareming/22.txt");// 建立数据输出通道FileOutputStream fileOutPutStream;try {fileOutPutStream = new FileOutputStream(file);for (int i = 1; i <= 9; i++) {for (int j = 1; j <= i; j++) {// System.out.print(i+"*"+j+"="+i*j+"\t");String data = i + "*" + j + "=" + i * j + "\t";fileOutPutStream.write(data.getBytes());}String data = "\r\n";//把乘法表写进文件中fileOutPutStream.write(data.getBytes());}System.out.println("打印成功");fileOutPutStream.close();} catch (FileNotFoundException e) {// TODO Auto-generated catch blockSystem.out.println("找不到目录");e.printStackTrace();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}

字节流中的输出流的一些应用(复制)+异常处理:代码如下:

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;public class FileOutputStreamTest2 {public static void main(String[] args) {//找到目标文件File infile=new File("d:/shareming/22.txt");File destFile=new File("d:/shareming/23.txt");//建立数据输出通道FileInputStream fileInPutStream = null;FileOutputStream flleOutPutStream = null;try {fileInPutStream = new FileInputStream(infile);} catch (FileNotFoundException e) {// TODO Auto-generated catch blocke.printStackTrace();}try {flleOutPutStream = new FileOutputStream(destFile);} catch (FileNotFoundException e) {// TODO Auto-generated catch blocke.printStackTrace();}//从infile里面把数据读出来,然后把写进destfile里面byte[]buf=new byte[1024];int length=0;try {while((length=fileInPutStream.read(buf))!=-1){flleOutPutStream.write(buf,0,length);}} catch (IOException e) {// TODO Auto-generated catch blockSystem.out.println("读取失败");e.printStackTrace();}System.out.println("copy success");try {flleOutPutStream.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}try {fileInPutStream.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}

常见的异常
ClassCastException 类转换异常 比如Person类转成String类
正确写法为:
NullPointerException 空指针异常
IndexOutOfBoundsException 下标越界异常

http://www.lbrq.cn/news/2455687.html

相关文章:

  • wordpress修改文章字体颜色安卓优化大师新版
  • 彭州做网站的公司口碑营销的形式
  • 国外网站建设推广短视频培训课程
  • 我有域名怎么做网站百度提交网站收录入口
  • wordpress如何关注博客外贸网站推广与优化
  • 智能建站系统cms淘宝标题优化工具推荐
  • 建wap网站友情链接网址
  • 2023年北京疫情怎么样了河北seo诊断培训
  • 网站备案查询怎么查销售平台
  • 做接口自动化是网站登录加密莆田百度快照优化
  • 资深的金融行业网站开发东莞疫情最新消息今天
  • 山西大同网站建设价格app接入广告变现
  • 自适应网站模板怎么做信息流优化师没经验可以做吗
  • 门户网站信息发布管理办法乐云seo官网
  • 国内企业网站设计公司外贸网络推广营销
  • 企业的网站用vue做的网络营销做得好的品牌
  • 西安wordpress网站seo收录工具
  • 做影视网站对宽带要求站长查询域名
  • 深圳集团网站建设seo个人博客
  • 网上怎样做电缆网站9 1短视频安装
  • 高端品牌网站设计企业网站建设百度免费推广怎么操作
  • 医院网站建设的目的营销渠道策划方案
  • 怎么将自己做的网站放到网上网优工程师前景和待遇
  • 做我女朋友网站安卓嗅探app视频真实地址
  • dede可以做购物网站吗股票指数是什么意思
  • 手机网站 jsp苏州网站外包
  • 怎样在商务部网站做备案衡阳seo快速排名
  • 中山 网站建设一条龙服务seo快速建站
  • php网站进后台长尾关键词有哪些
  • 广西金水建设开发有限公司网站线上销售渠道有哪几种
  • 数据赋能(332)——安全与合规——保密管理
  • DNS 服务正反向解析与 Web 集成实战:从配置到验证全流程
  • SaaS型小程序自动化发布解决方案
  • Qt(资源库和按钮组)
  • 13-C语言:第13天笔记
  • MIT线性代数01_方程组的几何解释