Package java.io

Examples of java.io.UnsupportedEncodingException


      _readStream.setEncoding(_readEncoding);
    } catch (UnsupportedEncodingException e) {
      throw e;
    } catch (java.nio.charset.UnsupportedCharsetException e) {
      throw new UnsupportedEncodingException(e.getMessage());
    }
  }
View Full Code Here


      // bufferedReader is just an adapter to get the signature right.
      _bufferedReader.init(getStream(true));

      return _bufferedReader;
    } catch (java.nio.charset.UnsupportedCharsetException e) {
      throw new UnsupportedEncodingException(e.getMessage());
    }
  }
View Full Code Here

    if (toByte != null)
      _toByte = toByte;
    else {
      _toByte = Encoding.getLatin1Writer();

      throw new UnsupportedEncodingException(encoding);
    }
  }
View Full Code Here

    {
      return new OutputStreamWriter(output, encoding);
    }
    catch( java.lang.IllegalArgumentException iae) // java 1.1.8
    {
      throw new UnsupportedEncodingException(encoding);
    }
  }
View Full Code Here

        InputStreamReader reader;
        try {
            String s = getCharSet(datasource.getContentType());
            reader = new InputStreamReader(datasource.getInputStream(), s);
        } catch (Exception ex) {
            throw new UnsupportedEncodingException(ex.toString());
        }
        StringWriter writer = new StringWriter();
        int ch;
        while ((ch = reader.read()) != -1) {
            writer.write(ch);
View Full Code Here

        OutputStreamWriter os;
        try {
            String charset = getCharSet(s);
            os = new OutputStreamWriter(outputstream, charset);
        } catch (Exception ex) {
            throw new UnsupportedEncodingException(ex.toString());
        }
        String content = (String) object;
        os.write(content, 0, content.length());
        os.flush();
    }
View Full Code Here

      if (b.getCharset().equals(ref) || b.getGroup().equals(ref)) {
        InputStream prefix = new ByteArrayInputStream(detectionBuffer, b.getHeaderLength(), bufferSize - b.getHeaderLength());
        return new InputStreamReader(new ConcatInputStream(prefix, in), b.getCharset());
      }
      else {
        throw new UnsupportedEncodingException("The requested encoding was " + encoding + " but the file contained a BOM for " + b.getCharset().name() + ".");
      }
    }
    else {
      InputStream prefix = new ByteArrayInputStream(detectionBuffer, 0, bufferSize);
      return new InputStreamReader(new ConcatInputStream(prefix, in), encoding);
View Full Code Here

      return bom.getCharset();
    }
    if (Charset.isSupported(charsetName)) {
      return Charset.forName(charsetName);
    }
    throw new UnsupportedEncodingException("Charset " + charsetName + " is not supported");
  }
View Full Code Here

                return message.getContent();
            }
            return message; // raw message
        } catch (Exception e) {
            // try to fix message in case it has an unsupported encoding in the Content-Type header
            UnsupportedEncodingException uee = ObjectHelper.getException(UnsupportedEncodingException.class, e);
            if (uee != null) {
                LOG.debug("Unsupported encoding detected: " + uee.getMessage());
                try {
                    String contentType = message.getContentType();
                    String type = ObjectHelper.before(contentType, "charset=");
                    if (type != null) {
                        // try again with fixed content type
View Full Code Here

        {
            PrivateKeyInfo info = PrivateKeyInfo.getInstance(ASN1Primitive.fromByteArray(key.getEncoded()));

            if (info.getAlgorithmId().getObjectId().equals(CryptoProObjectIdentifiers.gostR3410_2001))
            {
                throw new UnsupportedEncodingException("cannot convert GOST key to explicit parameters.");
            }
            else
            {
                X962Parameters params = X962Parameters.getInstance(info.getAlgorithmId().getParameters());
                X9ECParameters curveParams;
View Full Code Here

TOP

Related Classes of java.io.UnsupportedEncodingException

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.