public final class PtpIpInputStream
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
PtpIpInputStream(java.io.InputStream is)
Wrap InputStream by PtpIpInputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
PtpIpPacket.Type |
nextType()
Get type of next PTP-IP Packet.
|
CancelPacket |
readCancelPacket()
Read CancelPacket from the stream.
|
byte[] |
readData()
Process Data Phase (StartData -> [Data] -> EndData) and returns all data as byte array.
|
void |
readData(java.io.OutputStream dst)
Process Data Phase (StartData -> [Data] -> EndData) and writes all data to dst.
|
DataPacket |
readDataPacket()
Read DataPacket from the stream.
|
EndDataPacket |
readEndDataPacket()
Read EndDataPacket from the stream.
|
EventPacket |
readEventPacket()
Read EventPacket from the stream.
|
InitCommandAckPacket |
readInitCommandAckPacket()
Read InitCommandAckPacket from the stream.
|
InitCommandRequestPacket |
readInitCommandRequestPacket()
Read InitCommandRequestPacket from the stream.
|
InitEventAckPacket |
readInitEventAckPacket()
Read InitEventAckPacket from the stream.
|
InitEventRequestPacket |
readInitEventRequestPacket()
Read InitEventRequestPacket from the stream.
|
InitFailPacket |
readInitFailPacket()
Read InitFailPacket from the stream.
|
OperationRequestPacket |
readOperationRequestPacket()
Read OperationRequestPacket from the stream.
|
OperationResponsePacket |
readOperationResponsePacket()
Read OperationResponsePacket from the stream.
|
ProbeRequestPacket |
readProbeRequestPacket()
Read ProbeRequestPacket from the stream.
|
ProbeResponsePacket |
readProbeResponsePacket()
Read ProbeResponsePacket from the stream.
|
StartDataPacket |
readStartDataPacket()
Read StartDataPacket from the stream.
|
public PtpIpInputStream(java.io.InputStream is)
is
- public PtpIpPacket.Type nextType() throws java.io.IOException
java.io.IOException
public InitCommandRequestPacket readInitCommandRequestPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not InitCommandRequestPacket.java.io.IOException
public InitCommandAckPacket readInitCommandAckPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not InitCommandAckPacket.java.io.IOException
public InitEventRequestPacket readInitEventRequestPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not InitEventRequestPacket.java.io.IOException
public InitEventAckPacket readInitEventAckPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not InitEventAckPacket.java.io.IOException
public InitFailPacket readInitFailPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not InitFailPacket.java.io.IOException
public OperationRequestPacket readOperationRequestPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not OperationRequestPacket.java.io.IOException
public OperationResponsePacket readOperationResponsePacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not OperationResponsePacket.java.io.IOException
public EventPacket readEventPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not EventPacket.java.io.IOException
public StartDataPacket readStartDataPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not StartDataPacket.java.io.IOException
public DataPacket readDataPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not DataPacket.java.io.IOException
public EndDataPacket readEndDataPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not EndDataPacket.java.io.IOException
public CancelPacket readCancelPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not CancelPacket.java.io.IOException
public ProbeRequestPacket readProbeRequestPacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not ProbeRequestPacket.java.io.IOException
public ProbeResponsePacket readProbeResponsePacket() throws java.io.IOException
java.lang.RuntimeException
- if next packet is not ProbeResponsePacket.java.io.IOException
public byte[] readData() throws java.io.IOException, PtpException
java.io.IOException
PtpException
public void readData(java.io.OutputStream dst) throws java.io.IOException, PtpException
dst
- java.lang.RuntimeException
- if it is not Data Phase.java.io.IOException
PtpException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException