outstream.java
来自「this is a sample of a java bot. use to e」· Java 代码 · 共 30 行
JAVA
30 行
import java.io.OutputStream;
import java.io.IOException;
class OutStream {
private OutputStream out;
public OutStream(OutputStream out) {
this.out = out;
}
public void write(byte[] buffer, int offset, int len) throws IOException {
this.out.write(buffer, offset, len);
}
public void writeInt(int i) throws IOException {
byte[] buffer = { (byte)(i >> 24), (byte)(i >> 16), (byte)(i >> 8), (byte)i };
this.out.write(buffer, 0, 4);
}
public void writeString(String str) throws IOException {
writeInt(str.length());
this.out.write(str.getBytes(), 0, str.length());
}
public OutputStream getOutputStream() {
return this.out;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?