彦舜原创,CSDN首发:Input-OutputStream

本文深入探讨了Java后端开发中的输入输出流(IO流)技术,包括基本概念、分类、常用API及其应用场景,旨在帮助读者理解并熟练运用IO流进行数据传输。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/**
 * 
 */
package io.java;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author 彦舜
 *
 */
public class IOInputOutputStream {

	/**
	 * 
	 */
	public IOInputOutputStream() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param args
	 * @throws IOException
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub

		/** Test InputStream and OutputStream for IO Byte Stream. */
		testIOputStream();
	}
	
	/**Test InputStream and OutputStream for IO Byte Stream 
	 * @throws IOException */
	@SuppressWarnings("null")
	public static void testIOputStream() throws IOException {
		/**1.InputStream
		   
		   Create a instanced InputStream object.
		  
		   InputStream cannot be resolved to a type
		   FileInputStream cannot be resolved to a type
		   --Import 'ClassName' (java.io)
		   --(Add type parameter 'ClassName' to 'method()')
		   --Fix project setup......
		   
		   Unhandled exception type FileNotFoundException
		   --Add throws declaration
		   --Surround with try/catch
		   
		   File cannot be resolved to a type
		   --Import 'File' (java.io)
		   
		   FileNotFoundException cannot be resolved to a type
		   --Import 'FileNotFoundException' (java.io)
		   
		   IOException cannot be resolved to a type
		   --Import 'IOExeption' (java.io)
		   
		   The value of the local variable field is not used
		   --Remove 'field' and all assignments
		   --Remove 'field', keep assignments with side effects
		   ----Fix 2 problems of same category in file
		   --Add @SuppressWarnings 'unused' to 'field'/'method()'
		   --Configure problem severity配置问题的严重程度/配置问题的严重性
		   
		   The import java.io.FileNotFoundException is never used
		   --Remove unused import
		   --Organize imports
		   --Add @SuppressWarnings 'unused' to 'ClassName'
		   --Configure problem severity
		   
		   The value of the local variable field is not used
		   --Remove 'field' and all assignments
		   --Remove 'field', keep assignments with side effects
		   --Add @SuppressWarnings 'unused' to 'field'/&
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值