예제 #1
0
 public static CacheControl fromFile(PeterO.Support.File f)
 {
     PeterO.Support.WrappedInputStream fs=new PeterO.Support.WrappedInputStream(new FileStream(f.ToString(),FileMode.Open));
     try {
       return new CacheControlSerializer().readObjectFromStream(fs);
     } finally {
       if(fs!=null) {
     fs.Close();
       }
     }
 }
예제 #2
0
 public static string fileToString(PeterO.Support.File file)
 {
     PeterO.Support.WrappedInputStream input = null;
     try {
         input = new PeterO.Support.WrappedInputStream(new FileStream((file).ToString(), FileMode.Open));
         return(streamToString(input));
     } finally {
         if (input != null)
         {
             input.Close();
         }
     }
 }