public class SimpleSocketInputStream extends CloseableThread implements PushSourceStream
closingLENGTH_UNKNOWN| Constructor and Description |
|---|
SimpleSocketInputStream(java.net.DatagramSocket socket)
Creates a new SocketInputStream
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
endOfStream()
Have we reached the end of stream?
|
ContentDescriptor |
getContentDescriptor()
Returns the content descriptor.
|
long |
getContentLength()
Returns the content's length.
|
java.lang.Object |
getControl(java.lang.String controlType)
DUMMY.
|
java.lang.Object[] |
getControls()
DUMMY.
|
int |
getMinimumTransferSize()
Returns the minimum transfer size.
|
void |
kill()
Stops the socket
|
void |
notifyTransferHandlerAsync() |
int |
read(byte[] buffer,
int offset,
int length)
Read a datagram packet and write it into the provided buffer.
|
void |
run()
Walk...
|
void |
setTransferHandler(SourceTransferHandler transferHandler)
Sets the transfer handler for this stream.
|
close, isClosed, isClosing, setClosed, setClosing, waitUntilClosedactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic SimpleSocketInputStream(java.net.DatagramSocket socket)
socket - The socket to handlepublic int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in interface PushSourceStreambuffer - the buffer to write the packets tooffset - offset after which we can writelength - total lengthjava.io.IOExceptionpublic int getMinimumTransferSize()
getMinimumTransferSize in interface PushSourceStreampublic void setTransferHandler(SourceTransferHandler transferHandler)
setTransferHandler in interface PushSourceStreamtransferHandler - the transfer handlerpublic void notifyTransferHandlerAsync()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic ContentDescriptor getContentDescriptor()
getContentDescriptor in interface SourceStreampublic long getContentLength()
getContentLength in interface SourceStreampublic boolean endOfStream()
endOfStream in interface SourceStreampublic java.lang.Object[] getControls()
getControls in interface Controlspublic java.lang.Object getControl(java.lang.String controlType)
getControl in interface ControlscontrolType - UNUSED.public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void kill()