00001 package commandline.binToFilePackage;
00002
00003 import java.io.BufferedInputStream;
00004 import java.io.DataInputStream;
00005 import java.io.IOException;
00006 import java.io.InputStream;
00007
00008 import commandline.CodingUtils.ByteConvertor;
00009
00010
00011
00012 public class MyDataInPutStream extends DataInputStream{
00013
00014 public MyDataInPutStream(InputStream inputStream) {
00015 super(new BufferedInputStream(inputStream));
00016 }
00017
00018 public synchronized int readMyShort(){
00019 int getal=0;
00020 try{
00021 getal=(int)super.readShort();
00022 }catch(IOException exception){
00023 exception.printStackTrace(System.out);
00024 }
00025 return getal;
00026 }
00027
00028
00029 public synchronized float readMyFloat(){
00030 float getal=0;
00031 try{
00032 getal=super.readFloat();
00033 }catch(IOException exception){
00034 exception.printStackTrace(System.out);
00035 }
00036 return getal;
00037 }
00038
00039 public synchronized int readMyInt(){
00040 int getal=0;
00041 try{
00042 getal=super.readInt();
00043 }catch(IOException exception){
00044 exception.printStackTrace(System.out);
00045 }
00046 return getal;
00047 }
00048
00049
00050 public synchronized void readMyBytes(int[] bytes) throws IOException{
00051 for(int i=0;i!=bytes.length;i++){
00052 bytes[i]=readMyByte();
00053 }
00054 }
00055
00056 public synchronized int readMyByte() throws IOException{
00057 byte b=super.readByte();
00058 return ByteConvertor.javabyteToMyByte(b);
00059 }
00060
00061
00062
00063
00064 }