com.legstar.coxb.convert
Interface ICobolBinaryConverter

All Superinterfaces:
ICobolConverter

public interface ICobolBinaryConverter
extends ICobolConverter

This class uses the Strategy pattern to shield marshallers/unmarshallers from the specific Java numeric to cobol representation.

Author:
Fady Moussallam

Method Summary
 int fromHost(ICobolArrayBinaryBinding ce, byte[] hostSource, int offset, int currentOccurs)
          Converts an array of Cobol values from a host buffer to a java array.
 int fromHost(ICobolBinaryBinding ce, byte[] hostSource, int offset)
          Converts an element Cobol value from a host buffer to a java value.
 int toHost(ICobolArrayBinaryBinding ce, byte[] hostTarget, int offset, int currentOccurs)
          Converts an array of java values to a host representation stored in host buffer.
 int toHost(ICobolBinaryBinding ce, byte[] hostTarget, int offset)
          Converts an element java value to a host representation stored in host buffer.
 
Methods inherited from interface com.legstar.coxb.convert.ICobolConverter
getCobolContext, setCobolContext
 

Method Detail

toHost

int toHost(ICobolBinaryBinding ce,
           byte[] hostTarget,
           int offset)
           throws HostException
Converts an element java value to a host representation stored in host buffer.

Parameters:
ce - Cobol element descriptor
hostTarget - Target host buffer
offset - Offset in the target host buffer
Returns:
the new offset after host buffer has been updated
Throws:
HostException - if conversion fails

toHost

int toHost(ICobolArrayBinaryBinding ce,
           byte[] hostTarget,
           int offset,
           int currentOccurs)
           throws HostException
Converts an array of java values to a host representation stored in host buffer.

Parameters:
ce - Cobol array descriptor
hostTarget - Target host buffer
offset - Offset in the target host buffer
currentOccurs - actual number of items in array
Returns:
the new offset after host buffer has been updated
Throws:
HostException - if conversion fails

fromHost

int fromHost(ICobolBinaryBinding ce,
             byte[] hostSource,
             int offset)
             throws HostException
Converts an element Cobol value from a host buffer to a java value.

Parameters:
ce - Cobol element descriptor
hostSource - Source host buffer
offset - Offset in the source host buffer
Returns:
the new offset after host buffer has been read
Throws:
HostException - if conversion fails

fromHost

int fromHost(ICobolArrayBinaryBinding ce,
             byte[] hostSource,
             int offset,
             int currentOccurs)
             throws HostException
Converts an array of Cobol values from a host buffer to a java array.

Parameters:
ce - Cobol array descriptor
hostSource - Source host buffer
offset - Offset in the source host buffer
currentOccurs - actual number of items in array
Returns:
the new offset after host buffer has been read
Throws:
HostException - if conversion fails


Copyright © 2015 LegSem. All Rights Reserved.