Package com.hierynomus.smbj.io
Class ByteChunkProvider
- java.lang.Object
-
- com.hierynomus.smbj.io.ByteChunkProvider
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
ArrayByteChunkProvider,BufferByteChunkProvider,ByteBufferByteChunkProvider,EmptyByteChunkProvider,FileByteChunkProvider,InputStreamByteChunkProvider
public abstract class ByteChunkProvider extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description protected static intCHUNK_SIZEprotected intchunkSizeprotected longoffset
-
Constructor Summary
Constructors Constructor Description ByteChunkProvider()
-
Method Summary
Modifier and Type Method Description abstract intbytesLeft()voidclose()protected abstract intgetChunk(byte[] chunk)intgetChunkSize()intgetLastWriteSize()longgetOffset()abstract booleanisAvailable()abstract voidprepareWrite(int maxBytesToPrepare)voidwriteChunk(Buffer<?> buffer)voidwriteChunk(java.io.OutputStream os)voidwriteChunks(Buffer<?> buffer, int nrChunks)
-
-
-
Field Detail
-
CHUNK_SIZE
protected static final int CHUNK_SIZE
- See Also:
- Constant Field Values
-
offset
protected long offset
-
chunkSize
protected int chunkSize
-
-
Method Detail
-
isAvailable
public abstract boolean isAvailable()
-
prepareWrite
public abstract void prepareWrite(int maxBytesToPrepare)
-
writeChunk
public void writeChunk(java.io.OutputStream os)
-
writeChunks
public void writeChunks(Buffer<?> buffer, int nrChunks)
-
writeChunk
public void writeChunk(Buffer<?> buffer)
-
getChunkSize
public int getChunkSize()
-
getOffset
public long getOffset()
-
getLastWriteSize
public int getLastWriteSize()
-
getChunk
protected abstract int getChunk(byte[] chunk) throws java.io.IOException- Throws:
java.io.IOException
-
bytesLeft
public abstract int bytesLeft()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-