/[gzz]/gzz/lava/gzz/storm/impl/DirPool.java
ViewVC logotype

Diff of /gzz/lava/gzz/storm/impl/DirPool.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by benja, Mon Dec 23 03:20:59 2002 UTC revision 1.14 by benja, Sun Dec 29 20:02:49 2002 UTC
# Line 37  public class DirPool extends AbstractLoc Line 37  public class DirPool extends AbstractLoc
37    
38      /** Get the File object for the block      /** Get the File object for the block
39       *  corresponding to a given id.       *  corresponding to a given id.
40         *  This is needed in many places and wrapping it in a convenience
41         *  function makes code easier to read & maintain.
42       */       */
43      protected File getFile(BlockId id) {      protected final File getFile(BlockId id) {
44          String hex = gzz.util.HexUtil.byteArrToHex(id.getBytes());          String hex = gzz.util.HexUtil.byteArrToHex(id.getBytes());
45          return new File(dir, "b_" + hex);          return new File(dir, "b_" + hex);
46      }      }
47    
48      /** Read the header of the block      /** Read the header of the block
49       *  corresponding to the given id.       *  corresponding to the given id.
50         *  Like getFile(), this is needed in a number
51         *  of different places.
52       */       */
53      protected Header822 getFileHeader(BlockId id) throws IOException {      protected final Header822 getFileHeader(BlockId id) throws IOException {
54          InputStream is = new BufferedInputStream(          InputStream is = new BufferedInputStream(
55              id.getCheckedInputStream(new FileInputStream(getFile(id))));              id.getCheckedInputStream(new FileInputStream(getFile(id))));
56          Header822 header = Headers822.readHeader(is);          Header822 header = Headers822.readHeader(is);
# Line 56  public class DirPool extends AbstractLoc Line 60  public class DirPool extends AbstractLoc
60            
61    
62      protected class FileBlockOutputStream extends AbstractBlockOutputStream {      protected class FileBlockOutputStream extends AbstractBlockOutputStream {
         protected ByteArrayOutputStream baos;  
63          protected File tempFile;          protected File tempFile;
64    
65          protected FileBlockOutputStream(Header822 header, File tempFile)          protected FileBlockOutputStream(Header822 header, File tempFile)

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26