⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 encryptoutputstream.java

📁 加密解密程序,实现了加密解密功能,无解密密码
💻 JAVA
字号:
import java.io.*;

public class EncryptOutputStream extends FilterOutputStream  
{
	public EncryptOutputStream(OutputStream out)
	{
	  super(out);
	}
	
	public byte Encrypt(byte b)
	{
	  int  key=240; //  11110000
	  return (byte)(b^key);
	} 
	
	public void ewrite(int b) throws IOException
	{
	   byte w=this.Encrypt((byte)b)	;
	   super.write(w);
	}
	
	public void ewrite(byte[] b) throws IOException
	{ 
	   byte[] w=new byte[b.length];
	   for(int i=0;i<b.length;i++)
	       w[i]=this.Encrypt(b[i]);
	     super.write(w);
	}
	
	public void ewrite(byte[] b,int off,int len) throws IOException
	{  
	   byte[] w=new byte[b.length];
	   for(int i=0;i<b.length;i++)
	       w[i]=this.Encrypt(b[i])	;
	   super.write(w,off,len);
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -