Package com.hierynomus.smbj.share
Class NamedPipe
- java.lang.Object
-
- com.hierynomus.smbj.share.Open<PipeShare>
-
- com.hierynomus.smbj.share.NamedPipe
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.hierynomus.smbj.share.Open
Open.LockBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
byte[]
ioctl(long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength)
Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.int
ioctl(long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, byte[] outData, int outOffset, int outLength)
Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.FsCtlPipePeekResponse
peek()
Requests that the server read data from this pipe without removing it.FsCtlPipePeekResponse
peek(int maxDataSize)
Requests that the server read data from this pipe without removing it.int
read(byte[] buffer)
Read data from this pipe starting into the given buffer.int
read(byte[] buffer, int offset, int length)
Read data from this pipe into the given buffer.byte[]
transact(byte[] inBuffer)
Performs a transaction on this pipe.int
transact(byte[] inBuffer, byte[] outBuffer)
Performs a transaction on this pipe.int
transact(byte[] inBuffer, int inOffset, int inLength, byte[] outBuffer, int outOffset, int outLength)
Performs a transaction on this pipe.int
write(byte[] buffer)
Write the data in buffer to this pipe.int
write(byte[] buffer, int offset, int length)
Write the data in buffer to this pipe.-
Methods inherited from class com.hierynomus.smbj.share.Open
close, closeSilently, getFileId, requestLock
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
-
write
public int write(byte[] buffer)
Write the data in buffer to this pipe.- Parameters:
buffer
- the data to write- Returns:
- the actual number of bytes that was written to the file
-
write
public int write(byte[] buffer, int offset, int length)
Write the data in buffer to this pipe.- Parameters:
buffer
- the data to writeoffset
- 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
-
read
public int read(byte[] buffer)
Read data from this pipe starting into the given buffer.- Parameters:
buffer
- the buffer to write into- Returns:
- the actual number of bytes that were read
-
read
public int read(byte[] buffer, int offset, int length)
Read data from this pipe into the given buffer.- Parameters:
buffer
- the buffer to write intooffset
- the start offset in the buffer at which to write datalength
- the maximum number of bytes to read- Returns:
- the actual number of bytes that were read
-
transact
public byte[] transact(byte[] inBuffer)
Performs a transaction on this pipe. This combines the writing a message to and reading a message from this pipe into a single network operation.- Parameters:
inBuffer
- the input message- Returns:
- the output message
-
transact
public int transact(byte[] inBuffer, byte[] outBuffer)
Performs a transaction on this pipe. This combines the writing a message to and reading a message from this pipe into a single network operation.This method is equivalent to calling
transact(inBuffer, 0, inBuffer.length, outBuffer, 0, outBuffer.length
.- Parameters:
inBuffer
- the input messageoutBuffer
- the buffer in which to write the output message- Returns:
- the number of bytes written to
outBuffer
-
transact
public int transact(byte[] inBuffer, int inOffset, int inLength, byte[] outBuffer, int outOffset, int outLength)
Performs a transaction on this pipe. This combines the writing a message to and reading a message from this pipe into a single network operation.- Parameters:
inBuffer
- the input messageinOffset
- the offset ininBuffer
at which the input message startinLength
- the length of the input message ininBuffer
starting atinOffset
outBuffer
- the buffer in which to write the output messageoutOffset
- the offset inoutBuffer
at which the output message should be writtenoutLength
- the maximum number of bytes that may be written tooutBuffer
starting fromoutOffset
- Returns:
- the number of bytes written to
outBuffer
-
peek
public FsCtlPipePeekResponse peek()
Requests that the server read data from this pipe without removing it. This method is equivalent to callingpeek(0)
.- Returns:
- the peek response
-
peek
public FsCtlPipePeekResponse peek(int maxDataSize)
Requests that the server read data from this pipe without removing it.- Parameters:
maxDataSize
- the maximum amount of data to peek- Returns:
- the peek response
-
ioctl
public byte[] ioctl(long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength)
Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.- Parameters:
ctlCode
- the control codeisFsCtl
- true if the control code is an FSCTL; false if it is an IOCTLinData
- the control code dependent input datainOffset
- the offset ininData
where the input data startsinLength
- the number of bytes frominData
to send, starting atoffset
- Returns:
- the response data or
null
if the control code did not produce a response
-
ioctl
public int ioctl(long ctlCode, boolean isFsCtl, byte[] inData, int inOffset, int inLength, byte[] outData, int outOffset, int outLength)
Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.- Parameters:
ctlCode
- the control codeisFsCtl
- true if the control code is an FSCTL; false if it is an IOCTLinData
- the control code dependent input datainOffset
- the offset ininData
where the input data startsinLength
- the number of bytes frominData
to send, starting atinOffset
outData
- the buffer where the response data should be writtenoutOffset
- the offset inoutData
where the output data should be writtenoutLength
- the maximum amount of data to write inoutData
, starting atoutOffset
- Returns:
- the number of bytes written to
outData
-
-