Package erjang

Examples of erjang.CharCollector


      }
     
      String pattern;
      if (unicode) {
        CharArrayWriter out = new CharArrayWriter();
        CharCollector cc = new CharCollector(StandardCharsets.UTF_8, out);
        try {
          ESeq rest = io_or_char_list.collectCharList(cc, ERT.NIL);
          cc.end();
        } catch (CollectingException e) {
          return null;
        } catch (InvalidElementException e) {
          return null;
        } catch (IOException e) {
View Full Code Here


    Charset encoding = encodingSpecToCharset(encodingSpec);
    if (encoding == null)
      throw ERT.badarg(charlist, encodingSpec);

    CharArrayWriter out = new CharArrayWriter();
    CharCollector collector = new CharCollector(encoding, out);

    ESeq rest = ERT.NIL;
    try {
      rest = charlist.collectCharList(collector, rest);
    } catch (CharCollector.InvalidElementException e) {
      throw ERT.badarg(charlist, encodingSpec);
    } catch (CharCollector.CollectingException e) {
      EObject data = output_converter.convert(out);
      return ETuple.make(ERROR_ATOM, data, e.restOfInput);
    } catch (IOException e) {
      throw new Error(e); // Not supposed to happen.
    }

    try {
      collector.end();

      if (rest != ERT.NIL) {
        return ETuple.make(INCOMPLETE_ATOM, 
                   output_converter.convert(out),
                   ErlConvert.iolist_to_binary(rest.reverse()));
View Full Code Here

TOP

Related Classes of erjang.CharCollector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.