Class PrependableSocket
- java.lang.Object
- 
- java.net.Socket
- 
- org.apache.zookeeper.server.quorum.PrependableSocket
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable
 
 public class PrependableSocket extends Socket 
- 
- 
Constructor SummaryConstructors Constructor Description PrependableSocket(SocketImpl base)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetInputStream()voidprependToInputStream(byte[] bytes, int offset, int length)Prepend some bytes that have already been read back to the socket's input stream.- 
Methods inherited from class java.net.Socketbind, close, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, toString
 
- 
 
- 
- 
- 
Constructor Detail- 
PrependableSocketpublic PrependableSocket(SocketImpl base) throws IOException - Throws:
- IOException
 
 
- 
 - 
Method Detail- 
getInputStreampublic InputStream getInputStream() throws IOException - Overrides:
- getInputStreamin class- Socket
- Throws:
- IOException
 
 - 
prependToInputStreampublic void prependToInputStream(byte[] bytes, int offset, int length) throws IOExceptionPrepend some bytes that have already been read back to the socket's input stream. Note that this method can be called at most once with a non-0 length per socket instance.- Parameters:
- bytes- the bytes to prepend.
- offset- offset in the byte array to start at.
- length- number of bytes to prepend.
- Throws:
- IOException- if this method was already called on the socket instance, or if super.getInputStream() throws.
 
 
- 
 
-