当前位置: 首页>>代码示例>>Java>>正文


Java IOException.toString方法代码示例

本文整理汇总了Java中java.io.IOException.toString方法的典型用法代码示例。如果您正苦于以下问题:Java IOException.toString方法的具体用法?Java IOException.toString怎么用?Java IOException.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.IOException的用法示例。


在下文中一共展示了IOException.toString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: play

import java.io.IOException; //导入方法依赖的package包/类
@Override
public void play(Song song) {
    reset();
    String path = song.getSource().getPath();
    try {
        setDataSource(path);
        mediaPlayer.prepare();
    } catch (IOException ioe) {
        throw new RuntimeException("Failed to play song:\n" + ioe.toString());
    } catch (IllegalStateException ise) {
        mediaPlayer.release();
        play(song); // retry
    }
    this.currentSong = song;
    mediaPlayer.start();
}
 
开发者ID:Captwalloper,项目名称:NUI_Project,代码行数:17,代码来源:PrototypeAudioPlayer.java

示例2: parseEntity

import java.io.IOException; //导入方法依赖的package包/类
/**
 * Parses the specified entity.
 *
 * @param importLocation
 *      The source location of the import/include statement.
 *      Used for reporting errors.
 */
public void parseEntity( InputSource source, boolean includeMode, String expectedNamespace, Locator importLocation )
        throws SAXException {

    documentSystemId = source.getSystemId();
    try {
        Schema s = new Schema(this,includeMode,expectedNamespace);
        setRootHandler(s);
        try {
            parser.parser.parse(source,this, getErrorHandler(), parser.getEntityResolver());
        } catch( IOException fnfe ) {
            SAXParseException se = new SAXParseException(fnfe.toString(), importLocation, fnfe);
            parser.errorHandler.warning(se);
        }
    } catch( SAXException e ) {
        parser.setErrorFlag();
        throw e;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:NGCCRuntimeEx.java

示例3: start

import java.io.IOException; //导入方法依赖的package包/类
private static void start()
{
    if(sProcess != null)
        return;
    LogUtils.i("ShellUtils start, root=" + sRoot);
    try {
        sProcess = Runtime.getRuntime().exec(sRoot ? "su" : "sh");
        sInStream = new OutputStreamWriter(sProcess.getOutputStream());
        sOutStream = new InputStreamReader(sProcess.getInputStream());
        sErrStream = new InputStreamReader(sProcess.getErrorStream());
    } catch (IOException e) {
        stdErr = "init LogUnit fail:" + e.toString();
        LogUtils.e(stdErr, e);
        AppModel.fatalError(stdErr);
    }

    LogUtils.i("ShellUtils is ready");
}
 
开发者ID:XndroidDev,项目名称:Xndroid,代码行数:19,代码来源:ShellUtils.java

示例4: doEndTag

import java.io.IOException; //导入方法依赖的package包/类
@Override
public int doEndTag() throws JspException {
    JspWriter out = pageContext.getOut();

    try {
        if (!"-1".equals(objectValue)) {
            out.print(objectValue);
        } else if (!"-1".equals(stringValue)) {
            out.print(stringValue);
        } else if (longValue != -1) {
            out.print(longValue);
        } else if (doubleValue != -1) {
            out.print(doubleValue);
        } else {
            out.print("-1");
        }
    } catch (IOException ex) {
        throw new JspTagException("IOException: " + ex.toString(), ex);
    }
    return super.doEndTag();
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:22,代码来源:ValuesTag.java

示例5: normalize

import java.io.IOException; //导入方法依赖的package包/类
private Appendable normalize(CharSequence src, Appendable dest,
                             UnicodeSet.SpanCondition spanCondition) {
    // Don't throw away destination buffer between iterations.
    StringBuilder tempDest=new StringBuilder();
    try {
        for(int prevSpanLimit=0; prevSpanLimit<src.length();) {
            int spanLimit=set.span(src, prevSpanLimit, spanCondition);
            int spanLength=spanLimit-prevSpanLimit;
            if(spanCondition==UnicodeSet.SpanCondition.NOT_CONTAINED) {
                if(spanLength!=0) {
                    dest.append(src, prevSpanLimit, spanLimit);
                }
                spanCondition=UnicodeSet.SpanCondition.SIMPLE;
            } else {
                if(spanLength!=0) {
                    // Not norm2.normalizeSecondAndAppend() because we do not want
                    // to modify the non-filter part of dest.
                    dest.append(norm2.normalize(src.subSequence(prevSpanLimit, spanLimit), tempDest));
                }
                spanCondition=UnicodeSet.SpanCondition.NOT_CONTAINED;
            }
            prevSpanLimit=spanLimit;
        }
    } catch(IOException e) {
        throw new InternalError(e.toString(), e);
    }
    return dest;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:FilteredNormalizer2.java

示例6: toString

import java.io.IOException; //导入方法依赖的package包/类
/**
 * Converts this stream's accumuated data into a string, translating bytes
 * into characters according to the platform's default character encoding.
 *
 * @return String translated from this stream's accumuated data.
 * @throws RuntimeException may be thrown if this output stream has been
 *      {@link #free() freed}.
 */
public synchronized String toString() {

    try {
        checkFreed();
    } catch (IOException ex) {
        throw new RuntimeException(ex.toString());
    }

    return new String(buf, 0, count);
}
 
开发者ID:s-store,项目名称:s-store,代码行数:19,代码来源:ClosableByteArrayOutputStream.java

示例7: getEncoded

import java.io.IOException; //导入方法依赖的package包/类
/**
 * Return the DER encoded form of the certificate pair.
 *
 * @return The encoded form of the certificate pair.
 * @throws CerticateEncodingException If an encoding exception occurs.
 */
public byte[] getEncoded() throws CertificateEncodingException {
    try {
        if (encoded == null) {
            DerOutputStream tmp = new DerOutputStream();
            emit(tmp);
            encoded = tmp.toByteArray();
        }
    } catch (IOException ex) {
        throw new CertificateEncodingException(ex.toString());
    }
    return encoded;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:19,代码来源:X509CertificatePair.java

示例8: startDocument

import java.io.IOException; //导入方法依赖的package包/类
public void startDocument()
    throws SAXException
{
    try {
        prepare();
    } catch ( IOException except ) {
        throw new SAXException( except.toString() );
    }
    // Nothing to do here. All the magic happens in startDocument(String)
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:BaseMarkupSerializer.java

示例9: DependencyDefinitionParser

import java.io.IOException; //导入方法依赖的package包/类
public DependencyDefinitionParser(String dependencyDefinition, DependencyProperties properties,
        ResultRenderer renderer) {
    this.properties = properties;
    this.renderer = renderer;
    final StringBuilder builder = new StringBuilder();
    try (final BufferedReader reader = new BufferedReader(new StringReader(dependencyDefinition))) {
        String line;
        int lineNumber = 0;
        int lineNumberOfCurrentLogicalLine = 1;
        while ((line = reader.readLine()) != null) {
            lineNumber++;
            line = line.trim();
            if (!line.startsWith("#")) {
                builder.append(line);
                if (line.endsWith("\\")) {
                    builder.deleteCharAt(builder.length() - 1).append(' ');
                } else {
                    final String logicalLine = replaceProperties(builder.toString().trim(),
                            lineNumberOfCurrentLogicalLine);
                    if (logicalLine.length() > 0) {
                        parseLine(logicalLine, lineNumberOfCurrentLogicalLine);
                    }
                    builder.setLength(0);
                    lineNumberOfCurrentLogicalLine = lineNumber + 1;
                }
            }
        }
    } catch (final IOException e) {
        throw new IllegalArgumentException(e.toString());
    }
}
 
开发者ID:sake92,项目名称:hepek-classycle,代码行数:32,代码来源:DependencyDefinitionParser.java

示例10: X509CRLEntryImpl

import java.io.IOException; //导入方法依赖的package包/类
/**
 * Unmarshals a revoked certificate from its encoded form.
 *
 * @param derVal the DER value containing the revoked certificate.
 * @exception CRLException on parsing errors.
 */
public X509CRLEntryImpl(DerValue derValue) throws CRLException {
    try {
        parse(derValue);
    } catch (IOException e) {
        revokedCert = null;
        throw new CRLException("Parsing error: " + e.toString());
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:X509CRLEntryImpl.java

示例11: readFile

import java.io.IOException; //导入方法依赖的package包/类
private String readFile(File f) {
    try {
        return new String(Files.readAllBytes(f.toPath()),
                StandardCharsets.UTF_8);
    } catch (IOException ex) {
        return "error reading " + f + " : " + ex.toString();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:JdiInitiator.java

示例12: println

import java.io.IOException; //导入方法依赖的package包/类
public void println() {
   try {
      write('\n');
   } catch (IOException ex) {
      throw new RuntimeException(ex.toString());
   }
}
 
开发者ID:eric-roberts,项目名称:JavaPPTX,代码行数:8,代码来源:PPOutputStream.java

示例13: reset

import java.io.IOException; //导入方法依赖的package包/类
/** Resets this to an empty buffer. */
public void reset() {
  try {
    seek(0);
  } catch (IOException e) {                     // should never happen
    throw new RuntimeException(e.toString());
  }

  file.length = 0;
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:11,代码来源:RAMOutputStream.java

示例14: doAfterBody

import java.io.IOException; //导入方法依赖的package包/类
@Override
public int doAfterBody() throws JspException {
    try {
        if (i == 3) {
            bodyOut.writeOut(bodyOut.getEnclosingWriter());
            return SKIP_BODY;
        }

        pageContext.setAttribute("member", atts[i]);
        i++;
        return EVAL_BODY_BUFFERED;
    } catch (IOException ex) {
        throw new JspTagException(ex.toString());
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:16,代码来源:FooTag.java

示例15: toString

import java.io.IOException; //导入方法依赖的package包/类
/**
 * Converts this writer's accumulated data into a string.
 *
 * @return String constructed from this writer's accumulated data
 * @throws RuntimeException may be thrown if this writer has been
 *      {@link #free() freed}.
 */
public synchronized String toString() {

    try {
        checkFreed();
    } catch (IOException ex) {
        throw new RuntimeException(ex.toString());
    }

    return new String(buf, 0, count);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:18,代码来源:ClosableCharArrayWriter.java


注:本文中的java.io.IOException.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。