Java 8 IOError - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 IOError class.

This code example shows how to use the following methods:getCause, toString
    /** 
     * @tests java.io.IOError#IOError(java.lang.Throwable) 
     * @since 1.6 
     */ 
    public void test_IOError_LThrowable() { 
        IOError e = new IOError(null);
        assertNull(e.getCause());
         
        String errorMsg = "java.io.IOError"; //$NON-NLS-1$
        assertTrue(e.toString().contains(errorMsg));
         
        errorMsg = "A dummy error"; //$NON-NLS-1$
        e = new IOError(new Throwable(errorMsg));
        assertTrue(e.toString().contains(errorMsg));
         
        try { 
            throw new IOError(null);
        }catch(IOError error) {
            return; 
        }catch(Error error) {
6
CodeRank
This code example shows how to use the following methods:
    public LayoutPullParser(String layoutPath) {
        assert layoutPath.startsWith("/");
        try { 
            init(getClass().getResourceAsStream(layoutPath));
        } catch (XmlPullParserException e) {
            throw new IOError(e);
        } 
    } 
 
    /** 
     * @param layoutFile Path of the layout xml file on disk. 
     */ 
    public LayoutPullParser(File layoutFile) {
        try { 
            init(new FileInputStream(layoutFile));
        } catch (XmlPullParserException e) {
            throw new IOError(e);
        } catch (FileNotFoundException e) {
            throw new IOError(e);
        } 
6
CodeRank
This code example shows how to use the following methods:
   
  private URI toDelegate(URI uri) {
    try { 
      return new URI(delegate.getScheme(), uri.getSchemeSpecificPart(), uri.getFragment());
    } catch (URISyntaxException e) {
      throw new IOError(e);
    } 
  } 
   
  /**  
   * Override to trigger some behavior when the filesystem is closed. 
   * <p> 
   * This is always called for each FilterFileSystemProvider in the chain. 
   */ 
  protected void onClose() { 
  } 
 
  @Override 
  public String toString() {
    return getClass().getSimpleName() + "(" + delegate + ")";
6
CodeRank
This code example shows how to use the following methods:
  @VisibleForTesting 
  static OutputStreamWriter utf8OutputStreamWriter(OutputStream outputStream) {
    try { 
      return new OutputStreamWriter(outputStream, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new IOError(e);
    } 
  } 
 
  private boolean isLoggableWithRegisteredLogLevel(LogRecord record) {
    long recordThreadId = record.getThreadID();
    String logRecordCommandId = threadIdToCommandId.get(recordThreadId);
    if (logRecordCommandId == null) {
      // An unregistered thread created this LogRecord, so we don't want to force logging it. 
      return false; 
    } 
    Level commandIdLogLevel = commandIdToLevel.get(logRecordCommandId);
    if (commandIdLogLevel == null) {
      // No log level override registered for this command ID. Don't force logging it. 
      return false; 
5
CodeRank
This code example shows how to use the following methods:
            return b;
 
        try { 
            return cipherIn.doFinal(b);
        } catch (Exception e) {
            throw new IOError(e);
        } 
 
    } 
 
 
    /** 
     * Compares comparables. Default comparator for most of java types 
     */ 
    static final Comparator COMPARABLE_COMPARATOR = new Comparator<Comparable>() {
        public int compare(Comparable o1, Comparable o2) { 
            return o1 == null && o2 != null ? -1 : (o1 != null && o2 == null ? 1 : o1.compareTo(o2)); 
        } 
    }; 
 
5
CodeRank
This code example shows how to use the following methods:
            RowMutation rm = RowMutation.serializer().deserialize(new DataInputStream(buffer)); 
            rm.apply(); 
        } 
        catch (IOException e) 
        { 
            throw new IOError(e); 
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
                                              BufferedRandomAccessFile.DEFAULT_BUFFER_SIZE, 
                                              true); 
        } 
        catch (IOException e) 
        { 
            throw new IOError(e); 
        } 
    } 
 
    protected DecoratedKey computeNext() 
    { 
        try 
        { 
            if (in.isEOF()) 
                return endOfData(); 
            DecoratedKey key = SSTableReader.decodeKey(StorageService.getPartitioner(), desc, ByteBufferUtil.readWithShortLength(in)); 
            in.readLong(); // skip data position 
            return key; 
        } 
        catch (IOException e) 
5
CodeRank
This code example shows how to use the following methods:
                w.close();
            } finally { 
                output.close();
            } 
        } catch (IOException e) {
            throw new IOError(e);
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
            if (exitStatus == 0) {
 
                // load U in memory, since that is what most algorithms will be 
                // using (i.e. it is the word space) 
                U = MatrixIO.readMatrix(uOutput, Format.DENSE_TEXT, 
                                        Type.DENSE_IN_MEMORY); 
                scaledClassFeatures = false; 
 
                // Sigma only has n values for an n^2 matrix, so make it sparse 
                Matrix S = MatrixIO.readMatrix(sOutput, Format.DENSE_TEXT, 
                                               Type.SPARSE_ON_DISK); 
                singularValues = new double[dimensions];
                for (int s = 0; s < dimensions; ++s)
                    singularValues[s] = S.get(s, s);
 
                // Octave does not transpose V, so transpose it 
                V = MatrixIO.readMatrix(vOutput, Format.DENSE_TEXT, 
                                        Type.DENSE_ON_DISK, true); 
                scaledDataClasses = false; 
            } 
5
CodeRank
This code example shows how to use the following methods:
        protected void setupCurrentDoc(File currentDocName) {
            try { 
                bloglinesReader =
                    new BufferedReader(new FileReader(currentDocName));
            } catch (IOException ioe) {
                throw new IOError(ioe);
            } 
        } 
 
        /** 
         * Iterates over the utterances in a file and appends the words to create a 
         * new document. 
         */ 
        protected Document advanceInDoc() { 
            String line = null;
            StringBuilder content = null;
            boolean inContent = false;
            try { 
                // Read through a single content block, and possibly a the 
                // timestamp, to extract a single document. 
5
CodeRank
See Code Examples for Java 8 IOError Methods: