📄 encryptoutputstream.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 + -