org.neociclo.odetteftp.protocol
Class DataExchangeBuffer
java.lang.Object
org.neociclo.odetteftp.protocol.DataExchangeBuffer
- All Implemented Interfaces:
- OdetteFtpExchangeBuffer
public class DataExchangeBuffer
- extends Object
- implements OdetteFtpExchangeBuffer
DataExchange is an type of Odette FTP Exchange Buffer used for encapsulate
and transmit of Virtual File records.
For transmission of Virtual File records, data is divided into Subrecords,
each of which is preceded by a one octet Subrecord Header.
The Data Exchange Buffer is made up of the initial Command character,
o--------------------------------------------------------
| C | H | | H | | H | | /
| M | D | SUBRECORD | D | SUBRECORD | D | SUBRECORD | /_
| D | R | | R | | R | | /
o-------------------------------------------------------
- Version:
- $Rev: 463 $ $Date: 2010-07-02 18:37:41 -0300 (Fri, 02 Jul 2010) $
- Author:
- Rafael Marins
DataExchangeBuffer
public DataExchangeBuffer(int dataExchangeBufferSize)
DataExchangeBuffer
public DataExchangeBuffer(ByteBuffer rawBuffer)
getRawBuffer
public ByteBuffer getRawBuffer()
- Specified by:
getRawBuffer
in interface OdetteFtpExchangeBuffer
getIdentifier
public CommandIdentifier getIdentifier()
throws OdetteFtpException
- Description copied from interface:
OdetteFtpExchangeBuffer
- Return the corresponding
CommandIdentifier
relative to the
Exchange Buffer contents. Its value is parsed from the first octet of the
Exchange Buffer specified through class constructor.
The CommandIdentifier defines the format of the Exchange Buffer contents.
- Specified by:
getIdentifier
in interface OdetteFtpExchangeBuffer
- Returns:
- CommandIdentifier Instance relative to the command type of this
Exchange Buffer.
- Throws:
CommandNotRecognisedException
- Command identifier not recognized in the specified buffer.
OdetteFtpException
- See Also:
org.neociclo.odetteftp.service.CommandIdentifier
getSize
public int getSize()
- Specified by:
getSize
in interface OdetteFtpExchangeBuffer
availableBytes
public int availableBytes()
available
public boolean available()
clear
public void clear()
readData
public ByteBuffer readData()
writeData
public void writeData(byte[] subrecord,
boolean endOfRecord,
boolean compression,
byte count)
writeData
public void writeData(byte subrecord,
boolean endOfRecord,
boolean compression,
byte count)
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
setUnitCount
public void setUnitCount(int octets)
getUnitCount
public int getUnitCount()
ACCORD