1 package org
.spearce
.jgit
.lib
;
3 import java
.io
.IOException
;
4 import java
.io
.InputStream
;
6 /** Reader for a deltafied object stored in a pack file. */
7 abstract class DeltaPackedObjectReader
extends PackedObjectReader
{
8 DeltaPackedObjectReader(final PackFile pr
, final long offset
) {
13 public String
getType() throws IOException
{
14 if (objectType
== null) {
15 final ObjectReader b
= baseReader();
17 objectType
= b
.getType();
25 public long getSize() throws IOException
{
26 if (objectSize
== -1) {
27 final PatchDeltaStream p
;
28 p
= new PatchDeltaStream(packStream(), null);
29 objectSize
= p
.getResultLength();
35 public InputStream
getInputStream() throws IOException
{
36 final ObjectReader b
= baseReader();
37 final PatchDeltaStream p
= new PatchDeltaStream(packStream(), b
);
39 objectSize
= p
.getResultLength();
40 if (objectType
== null)
41 objectType
= b
.getType();
45 protected abstract ObjectReader
baseReader() throws IOException
;