Java-source: Lire les valeurs unsigned byte d’un fichier

Author:

Java-source: Lire les valeurs unsigned byte d'un fichier
Download

/***** Code de MesExemples.com *******/
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
 
class ReadUnsignedByteFromFile {
 
public static void main(String[] args) {
 
String strFilePath = "C://test.txt";
 
try
{
 
FileInputStream fin = new FileInputStream(strFilePath);
DataInputStream din = new DataInputStream(fin);
 
 
int i = din.readUnsignedByte();
 
System.out.println("Unsinged byte value : " + i);
 
din.close();
 
}
catch(FileNotFoundException fe)
{
System.out.println("FileNotFoundException : " + fe);
}
catch(IOException ioe)
{
System.out.println("IOException : " + ioe);
}
}
}

Cet article Java-source: Lire les valeurs unsigned byte d’un fichier est apparu en premier sur .