2023-02-09 23:34:25 +01:00
|
|
|
package org.warp.commonutils.stream;
|
|
|
|
|
|
|
|
import java.io.DataInputStream;
|
|
|
|
import java.io.DataOutputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
|
|
|
|
public class DataInputOutputStream extends DataOutputStream implements DataInputOutput {
|
|
|
|
|
|
|
|
private final DataInputStream in;
|
|
|
|
|
|
|
|
public DataInputOutputStream(DataInputStream in, DataOutputStream out) {
|
|
|
|
super(out);
|
|
|
|
this.in = in;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public DataInputStream getIn() {
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public DataOutputStream getOut() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public void readFully(byte @NotNull [] bytes) throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
in.readFully(bytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public void readFully(byte @NotNull [] bytes, int i, int i1) throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
in.readFully(bytes, i, i1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public int skipBytes(int i) throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.skipBytes(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public boolean readBoolean() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readBoolean();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public byte readByte() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readByte();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public int readUnsignedByte() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readUnsignedByte();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public short readShort() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readShort();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public int readUnsignedShort() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readUnsignedShort();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public char readChar() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readChar();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public int readInt() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readInt();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public long readLong() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readLong();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public float readFloat() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readFloat();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public double readDouble() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readDouble();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public String readLine() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readLine();
|
|
|
|
}
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
@Override
|
2023-02-22 16:59:35 +01:00
|
|
|
public String readUTF() throws IOException {
|
2023-02-09 23:34:25 +01:00
|
|
|
return in.readUTF();
|
|
|
|
}
|
|
|
|
}
|