Package com.oss.asn1

Class Binary2CSVConvertor

java.lang.Object
com.oss.asn1.Binary2CSVConvertor

public class Binary2CSVConvertor extends Object
The BinaryToCSVConvertor is used to convert a binary data encoded with one of the Binary Encoding Rules into CSV format in one step.
Since:
ASN.1/Java 8.5
  • Constructor Details

    • Binary2CSVConvertor

      public Binary2CSVConvertor(BinaryCoder decoder, CSVTool encoder)
      Constructs the converter with the binary coder and the CSV printer objects.
      Parameters:
      decoder - input binary decoder.
      encoder - output CSV printer.
  • Method Details

    • getDecoder

      public Coder getDecoder()
      Returns the decoder that is used to decode the input stream.
      Returns:
      input decoder.
    • setDecoder

      public void setDecoder(BinaryCoder decoder)
      Sets the binary decoder.
      Parameters:
      decoder - input binary decoder.
    • getEncoder

      public CSVTool getEncoder()
      Returns the CSV printer object that is used to print the binary encoding in the CSV format.
      Returns:
      CSV printer object.
    • setEncoder

      public void setEncoder(CSVTool encoder)
      Sets output CSV printer.
      Parameters:
      encoder - output CSV printer.
    • convert

      public final void convert(InputStream source, PrintWriter sink, AbstractData pdu) throws DecodeFailedException, CSVPrintFailedException
      Decodes the source stream, containing the pdu value, and prints the decoded value in the CSV format to the sink output stream. If pdu detection is available for the input coder object, then the pdu parameter can be set to null.
      Parameters:
      source - input stream.
      sink - output stream.
      pdu - the PDU instance that will receive the decoded data. If pdu detection is available for the input coder object, then the parameter can be set to null.
      Throws:
      DecodeFailedException - thrown if the decode operation fails.
      CSVPrintFailedException - thrown if the decoded value cannot be printed in CSV format due to an error.