Class DfsInserter.PackStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.eclipse.jgit.internal.storage.dfs.DfsInserter.PackStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
- Enclosing class:
- DfsInserter
private class DfsInserter.PackStream extends java.io.OutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private intblockSize(package private) java.util.zip.DeflaterOutputStreamcompress(package private) java.util.zip.CRC32crc32private byte[]currBufprivate longcurrPosprivate intcurrPtrprivate java.util.zip.Deflaterdeflater(package private) byte[]hdrBufprivate java.security.MessageDigestmdprivate DfsOutputStreamout
-
Constructor Summary
Constructors Constructor Description PackStream(DfsOutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidbeginObject(int objectType, long length)voidclose()private byte[]copyOf(byte[] src, int ptr, int cnt)private intencodeTypeSize(int type, long rawLength)private voidflushBlock()(package private) longgetCount()private DfsBlockgetOrLoadBlock(long pos)(package private) byte[]inflate(DfsReader ctx, long pos, int len)(package private) intread(long pos, byte[] dst, int ptr, int cnt)private intsetInput(long pos, java.util.zip.Inflater inf)private longtoBlockStart(long pos)voidwrite(byte[] data, int off, int len)voidwrite(int b)private voidwriteNoHash(byte[] data, int off, int len)(package private) byte[]writePackFooter()
-
-
-
Field Detail
-
out
private final DfsOutputStream out
-
md
private final java.security.MessageDigest md
-
hdrBuf
final byte[] hdrBuf
-
deflater
private final java.util.zip.Deflater deflater
-
blockSize
private final int blockSize
-
currPos
private long currPos
-
currPtr
private int currPtr
-
currBuf
private byte[] currBuf
-
crc32
final java.util.zip.CRC32 crc32
-
compress
final java.util.zip.DeflaterOutputStream compress
-
-
Constructor Detail
-
PackStream
PackStream(DfsOutputStream out)
-
-
Method Detail
-
getCount
long getCount()
-
beginObject
void beginObject(int objectType, long length) throws java.io.IOException- Throws:
java.io.IOException
-
encodeTypeSize
private int encodeTypeSize(int type, long rawLength)
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] data, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
writeNoHash
private void writeNoHash(byte[] data, int off, int len) throws java.io.IOException- Throws:
java.io.IOException
-
flushBlock
private void flushBlock() throws java.io.IOException- Throws:
java.io.IOException
-
copyOf
private byte[] copyOf(byte[] src, int ptr, int cnt)
-
writePackFooter
byte[] writePackFooter() throws java.io.IOException- Throws:
java.io.IOException
-
read
int read(long pos, byte[] dst, int ptr, int cnt) throws java.io.IOException- Throws:
java.io.IOException
-
inflate
byte[] inflate(DfsReader ctx, long pos, int len) throws java.io.IOException, java.util.zip.DataFormatException
- Throws:
java.io.IOExceptionjava.util.zip.DataFormatException
-
setInput
private int setInput(long pos, java.util.zip.Inflater inf) throws java.io.IOException, java.util.zip.DataFormatException- Throws:
java.io.IOExceptionjava.util.zip.DataFormatException
-
getOrLoadBlock
private DfsBlock getOrLoadBlock(long pos) throws java.io.IOException
- Throws:
java.io.IOException
-
toBlockStart
private long toBlockStart(long pos)
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
-