package LeetDev.a3d;
import java.io.DataInputStream;
public class FileInput {
private DataInputStream m_dis = null;
public FileInput(final String filename) throws Exception
{
m_dis=new DataInputStream(getClass().getResourceAsStream(filename));
}
public void close()
{
try
{
m_dis.close();
}
catch(Exception e)
{
}
}
public int popInt() throws Exception
{
return(m_dis.readInt());
}
public short popShort() throws Exception
{
return(m_dis.readShort());
}
public float popFloat() throws Exception
{
return(((float)m_dis.readInt())/65536.0f);
}
public int popFixed() throws Exception
{
return(m_dis.readInt());
}
public String popString() throws Exception
{
StringBuffer b=new StringBuffer();
while(true)
{
byte tmp=m_dis.readByte();
if(tmp==0) {break;}
char tc=(char)tmp;
b.append(tc);
}
return(b.toString());
}
public byte popByte() throws Exception
{
return(m_dis.readByte());
}
}
|