public class TcpSend extends Object implements AutoCloseable, Flushable
| Modifier and Type | Method and Description |
|---|---|
TcpSend |
bufferSize(int bufferSize) |
void |
close() |
void |
flush() |
String |
getHost() |
InputStream |
getInput() |
OutputStream |
getOutput() |
int |
getPort() |
Socket |
getSocket() |
int |
read(byte[] bs) |
int |
read(byte[] bs,
int off,
int len)
读取数据
|
TcpSend |
send(byte send) |
TcpSend |
send(byte[] send) |
TcpSend |
send(byte[] send,
int off,
int len)
发送数据
|
TcpSend |
sendLf()
发送 \n
|
TcpSend |
timeout(int timeOut) |
public TcpSend(String host, int port) throws IOException
IOExceptionpublic TcpSend bufferSize(int bufferSize) throws SocketException
SocketExceptionpublic TcpSend timeout(int timeOut) throws SocketException
SocketExceptionpublic TcpSend send(byte send) throws IOException
IOExceptionpublic TcpSend send(byte[] send) throws IOException
IOExceptionpublic TcpSend send(byte[] send, int off, int len) throws IOException
send - bytesoff - offsetlen - lengthIOException - IOExceptionpublic TcpSend sendLf() throws IOException
IOException - IOExceptionpublic void flush()
throws IOException
flush in interface FlushableIOExceptionpublic int read(byte[] bs)
throws IOException
IOExceptionpublic int read(byte[] bs,
int off,
int len)
throws IOException
bs - bytesoff - offsetlen - lengthIOException - IOExceptionpublic void close()
close in interface AutoCloseablepublic String getHost()
public int getPort()
public Socket getSocket()
public InputStream getInput()
public OutputStream getOutput()
Copyright © 2025. All rights reserved.