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.IOExceptionpublic InitCommandRequestPacket readInitCommandRequestPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not InitCommandRequestPacket.java.io.IOExceptionpublic InitCommandAckPacket readInitCommandAckPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not InitCommandAckPacket.java.io.IOExceptionpublic InitEventRequestPacket readInitEventRequestPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not InitEventRequestPacket.java.io.IOExceptionpublic InitEventAckPacket readInitEventAckPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not InitEventAckPacket.java.io.IOExceptionpublic InitFailPacket readInitFailPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not InitFailPacket.java.io.IOExceptionpublic OperationRequestPacket readOperationRequestPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not OperationRequestPacket.java.io.IOExceptionpublic OperationResponsePacket readOperationResponsePacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not OperationResponsePacket.java.io.IOExceptionpublic EventPacket readEventPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not EventPacket.java.io.IOExceptionpublic StartDataPacket readStartDataPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not StartDataPacket.java.io.IOExceptionpublic DataPacket readDataPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not DataPacket.java.io.IOExceptionpublic EndDataPacket readEndDataPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not EndDataPacket.java.io.IOExceptionpublic CancelPacket readCancelPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not CancelPacket.java.io.IOExceptionpublic ProbeRequestPacket readProbeRequestPacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not ProbeRequestPacket.java.io.IOExceptionpublic ProbeResponsePacket readProbeResponsePacket() throws java.io.IOException
java.lang.RuntimeException - if next packet is not ProbeResponsePacket.java.io.IOExceptionpublic byte[] readData()
throws java.io.IOException,
PtpException
java.io.IOExceptionPtpExceptionpublic void readData(java.io.OutputStream dst)
throws java.io.IOException,
PtpException
dst - java.lang.RuntimeException - if it is not Data Phase.java.io.IOExceptionPtpExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException