net.jetrix.protocols
Class AbstractProtocol
java.lang.Object
net.jetrix.protocols.AbstractProtocol
- All Implemented Interfaces:
- Protocol
- Direct Known Subclasses:
- ConsoleProtocol, IRCProtocol, QueryProtocol, TetrinetProtocol
public abstract class AbstractProtocol
- extends Object
- implements Protocol
Abstract protocol implementing the readLine(Reader) method.
- Since:
- 0.3
- Version:
- $Revision: 848 $, $Date: 2010-05-03 22:51:32 +0200 (lun., 03 mai 2010) $
- Author:
- Emmanuel Bourg
AbstractProtocol
public AbstractProtocol()
readFrame
public byte[] readFrame(InputStream in)
throws IOException
- Reads the next message frame from the specified input stream.
No charset decoding is performed at this stage.
- Throws:
IOException
readLine
public String readLine(InputStream in,
String encoding)
throws IOException
- Description copied from interface:
Protocol
- Read a line for this protocol. A line is ended by a \n or \r character,
or by a protocol specific end of line as defined by the
Protocol.getEOL()
method.
- Specified by:
readLine in interface Protocol
- Parameters:
in - the stream to be readencoding - the charset encoding used to read the message
- Throws:
IOException - thrown if the stream is closed
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2001-2010. All Rights Reserved.