You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BlockList.java 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.poifs.storage;
  16. import java.io.IOException;
  17. /**
  18. * Interface for lists of blocks that are mapped by block allocation
  19. * tables
  20. *
  21. * @author Marc Johnson (mjohnson at apache dot org
  22. */
  23. public interface BlockList
  24. {
  25. /**
  26. * remove the specified block from the list
  27. *
  28. * @param index the index of the specified block; if the index is
  29. * out of range, that's ok
  30. */
  31. public void zap(final int index);
  32. /**
  33. * remove and return the specified block from the list
  34. *
  35. * @param index the index of the specified block
  36. *
  37. * @return the specified block
  38. *
  39. * @exception IOException if the index is out of range or has
  40. * already been removed
  41. */
  42. public ListManagedBlock remove(final int index)
  43. throws IOException;
  44. /**
  45. * get the blocks making up a particular stream in the list. The
  46. * blocks are removed from the list.
  47. *
  48. * @param startBlock the index of the first block in the stream
  49. * @param headerPropertiesStartBlock the index of the first header block in the stream
  50. *
  51. * @return the stream as an array of correctly ordered blocks
  52. *
  53. * @exception IOException if blocks are missing
  54. */
  55. public ListManagedBlock [] fetchBlocks(final int startBlock, final int headerPropertiesStartBlock)
  56. throws IOException;
  57. /**
  58. * set the associated BlockAllocationTable
  59. *
  60. * @param bat the associated BlockAllocationTable
  61. *
  62. * @exception IOException
  63. */
  64. public void setBAT(final BlockAllocationTableReader bat)
  65. throws IOException;
  66. public int blockCount();
  67. } // end public interface BlockList