Package com.hierynomus.smbj.share
Class SMB2Writer
java.lang.Object
com.hierynomus.smbj.share.SMB2Writer
Generic class that allows to write data to a share entry (Be it a printer or
a file)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetOutputStream
(ProgressListener listener, long offset) long
write
(byte[] buffer, long fileOffset) Write the data in buffer to this file at position fileOffset.long
write
(byte[] buffer, long fileOffset, int offset, int length) Write the data in buffer to this file at position fileOffset.long
write
(ByteChunkProvider provider) Write all available data from the byte chunk provider to this file.long
write
(ByteChunkProvider provider, ProgressListener progressListener) Write all available data from the byte chunk provider to this file.writeAsync
(byte[] buffer, long fileOffset, int offset, int length) Write the data Async in buffer to this file at position fileOffset.writeAsync
(ByteChunkProvider provider) Async Write all available data from the byte chunk provider to this file.
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
fileId
-
entryName
-
-
Constructor Details
-
Method Details
-
write
public long write(byte[] buffer, long fileOffset) Write the data in buffer to this file at position fileOffset.- Parameters:
buffer
- the data to writefileOffset
- The offset, in bytes, into the file to which the data should be written- Returns:
- the actual number of bytes that was written to the file
-
write
public long write(byte[] buffer, long fileOffset, int offset, int length) Write the data in buffer to this file at position fileOffset.- Parameters:
buffer
- the data to writefileOffset
- The offset, in bytes, into the file to which the data should be writtenoffset
- the start offset in the datalength
- the number of bytes that are written- Returns:
- the actual number of bytes that was written to the file
-
write
Write all available data from the byte chunk provider to this file. The offset in the file to which data is written is determined byByteChunkProvider.getOffset()
.- Parameters:
provider
- the byte chunk provider- Returns:
- the actual number of bytes that was written to the file
-
write
Write all available data from the byte chunk provider to this file. The offset in the file to which data is written is determined byByteChunkProvider.getOffset()
.- Parameters:
provider
- the byte chunk providerprogressListener
- an optional callback that will be invoked when data has been written to the file- Returns:
- the actual number of bytes that was written to the file
-
writeAsync
Write the data Async in buffer to this file at position fileOffset.- Parameters:
buffer
- the data to writefileOffset
- The offset, in bytes, into the file to which the data should be writtenoffset
- the start offset in the datalength
- the number of bytes that are written- Returns:
- A Future containing the total number of bytes written
-
writeAsync
Async Write all available data from the byte chunk provider to this file. The offset in the file to which data is written is determined byByteChunkProvider.getOffset()
.- Parameters:
provider
- the byte chunk provider- Returns:
- the List of write response future
-
getOutputStream
-
getOutputStream
-