@@ -0,0 +1,2631 @@
+package co.phoenixlab.common.lang.io;%0A%0Aimport java.io.*;%0A%0A/**%0A * A little-endian version of Java's DataInputStream (which is big-endian)%0A */%0Apublic class LittleEndianDataInputStream extends FilterInputStream implements DataInput %7B%0A%0A    private final DataInputStream parent;%0A%0A    /**%0A     * Wraps an existing DataInputStream for reading as little-endian%0A     * @param in The DataInputStream to wrap%0A     */%0A    public LittleEndianDataInputStream(DataInputStream in) %7B%0A        super(in);%0A        parent = in;%0A    %7D%0A%0A    /**%0A     * Wraps an existing InputStream for reading as a little-endian DataInputStream%0A     * @param in The InputStream to wrap%0A     */%0A    public LittleEndianDataInputStream(InputStream in) %7B%0A        this(new DataInputStream(in));%0A    %7D%0A%0A    @Override%0A    public void readFully(byte%5B%5D b) throws IOException %7B%0A        parent.readFully(b);%0A    %7D%0A%0A    @Override%0A    public void readFully(byte%5B%5D b, int off, int len) throws IOException %7B%0A        parent.readFully(b, off, len);%0A    %7D%0A%0A    @Override%0A    public int skipBytes(int n) throws IOException %7B%0A        return parent.skipBytes(n);%0A    %7D%0A%0A    @Override%0A    public boolean readBoolean() throws IOException %7B%0A        return parent.readBoolean();%0A    %7D%0A%0A    @Override%0A    public byte readByte() throws IOException %7B%0A        return parent.readByte();%0A    %7D%0A%0A    @Override%0A    public int readUnsignedByte() throws IOException %7B%0A        return parent.readUnsignedByte();%0A    %7D%0A%0A    @Override%0A    public short readShort() throws IOException %7B%0A        return Short.reverseBytes(parent.readShort());%0A    %7D%0A%0A    @Override%0A    public int readUnsignedShort() throws IOException %7B%0A        return Short.toUnsignedInt(readShort());%0A    %7D%0A%0A    @Override%0A    public char readChar() throws IOException %7B%0A        return Character.reverseBytes(parent.readChar());%0A    %7D%0A%0A    @Override%0A    public int readInt() throws IOException %7B%0A        return Integer.reverseBytes(parent.readInt());%0A    %7D%0A%0A    public long readUnsignedInt() throws IOException %7B%0A        return Integer.toUnsignedLong(readInt());%0A    %7D%0A%0A    @Override%0A    public long readLong() throws IOException %7B%0A        return Long.reverseBytes(parent.readLong());%0A    %7D%0A%0A    @Override%0A    public float readFloat() throws IOException %7B%0A        return Float.intBitsToFloat(readInt());%0A    %7D%0A%0A    @Override%0A    public double readDouble() throws IOException %7B%0A        return Double.longBitsToDouble(readLong());%0A    %7D%0A%0A    @Override%0A    public String readLine() throws IOException %7B%0A        return parent.readLine();%0A    %7D%0A%0A    @Override%0A    public String readUTF() throws IOException %7B%0A        return parent.readUTF();%0A    %7D%0A%7D%0A

Add LittleEndianDataInputStream