- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
public class DataRetriever
{
public static Object deserializeData(String fileName)
{
Object returnValue = null;
try
{
File inputFile = new File(fileName);
if (inputFile.exists() && inputFile.isFile())
{
try (ObjectInputStream readIn = new ObjectInputStream(new FileInputStream(fileName)))
{
returnValue = readIn.readObject();
}
}
else
{
throw new RuntimeException(new FileNotFoundException(fileName + " not found"));
}
}
catch (ClassNotFoundException | IOException exc)
{
throw new RuntimeException(exc);
}
return returnValue;
}
private DataRetriever() { throw new AssertionError(); }
}
roman-kashitsyn 17.01.2012 14:38 # +1
guest 17.01.2012 14:51 # +2
bugmenot 17.01.2012 16:42 # 0
Uhehesh 12.03.2012 21:21 # −2
guest 15.09.2012 13:39 # −1
guest8 09.04.2019 12:32 # −999