Java 8 UTFDataFormatException - 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 UTFDataFormatException class.

This code example shows how to use the following methods:toString
     * 
     * @param harness  the test harness (<code>null</code> not permitted). 
     */ 
    public void test(TestHarness harness)
    { 
        UTFDataFormatException object1 = new UTFDataFormatException();
        harness.check(object1 != null);
        harness.check(object1.toString(), "java.io.UTFDataFormatException");
 
        UTFDataFormatException object2 = new UTFDataFormatException("nothing happens");
        harness.check(object2 != null);
        harness.check(object2.toString(), "java.io.UTFDataFormatException: nothing happens");
 
        UTFDataFormatException object3 = new UTFDataFormatException(null);
        harness.check(object3 != null);
        harness.check(object3.toString(), "java.io.UTFDataFormatException");
 
    } 
} 
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    /** Throws an exception for expected byte. */ 
    private void expectedByte(int position, int count)
        throws UTFDataFormatException { 
 
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.expectedByte", 
				     Integer.toString(position),
				     Integer.toString(count)));
 
    } // expectedByte(int,int,int) 
 
    /** Throws an exception for invalid byte. */ 
    private void invalidByte(int position, int count, int c) 
        throws UTFDataFormatException { 
 
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.invalidByte", 
				     Integer.toString(position),
				     Integer.toString(count)));
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    /** Throws an exception for expected byte. */ 
    private void expectedByte(int position, int count)
        throws UTFDataFormatException {
 
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.expectedByte", 
                                     Integer.toString(position),
                                     Integer.toString(count)));
 
    } 
 
    /** Throws an exception for invalid byte. */ 
    private void invalidByte(int position, int count) 
        throws UTFDataFormatException {
 
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.invalidByte", 
                                     Integer.toString(position),
                                     Integer.toString(count)));
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    } // invalidByte(int,int,int,int) 
 
    /** Throws an exception for invalid surrogate bits. */ 
    private void invalidSurrogate(int uuuuu) throws UTFDataFormatException {
         
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.invalidHighSurrogate", 
				     Integer.toHexString(uuuuu)));
    } // invalidSurrogate(int) 
 
} // class UTF8Reader 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
  /** 
   * Generate exception messages without bloating code 
   */ 
  @NoInline 
  private static void throwDataFormatException(String message, int location) throws UTFDataFormatException {
    throw new UTFDataFormatException(message + " at location " + location);
  } 
 
  /** 
   * Visit all bytes of the given utf8 string calling the visitor when a 
   * character is decoded.<p> 
   * 
   * The acceptable input formats are controlled by the 
   * STRICTLY_CHECK_FORMAT, ALLOW_NORMAL_UTF8, and ALLOW_PSEUDO_UTF8 
   * flags. 
   * 
   * @param utf8 (pseudo-)utf8 byte array 
   * @param visitor called when characters are decoded 
   * @throws UTFDataFormatException if the (pseudo-)utf8 byte array is not valid (pseudo-)utf8 
   */ 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
	@Override 
	public SourceSpec[] getSourceSpecs() { 
		try { 
			return getSources(methodRef).toArray(new SourceSpec[] {});
		} catch (UTFDataFormatException e) {
			e.printStackTrace();
		} 
		return new SourceSpec[] {}; 
	} 
 
	/* (non-Javadoc) 
	 * @see spec.ISpecs#getSinkSpecs() 
	 */ 
	@Override 
	public SinkSpec[] getSinkSpecs() { 
		try { 
			return getSinks(methodRef).toArray(new SinkSpec[] {});
		} catch (UTFDataFormatException e) {
			e.printStackTrace();
		} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    /** Throws an exception for expected byte. */ 
    private void expectedByte(int position, int count)
        throws UTFDataFormatException { 
 
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.expectedByte", 
				     Integer.toString(position),
				     Integer.toString(count)));
 
    } // expectedByte(int,int,int) 
 
    /** Throws an exception for invalid byte. */ 
    private void invalidByte(int position, int count, int c) 
        throws UTFDataFormatException { 
 
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.invalidByte", 
				     Integer.toString(position),
				     Integer.toString(count)));
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    /** Throws an exception for invalid byte. */ 
    private void invalidByte(int position, int count, int c) 
        throws UTFDataFormatException {
 
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.invalidByte", 
				     Integer.toString(position),
				     Integer.toString(count)));
    } // invalidByte(int,int,int,int) 
 
    /** Throws an exception for invalid surrogate bits. */ 
    private void invalidSurrogate(int uuuuu) throws UTFDataFormatException {
         
        throw new UTFDataFormatException(
                Localizer.getMessage("jsp.error.xml.invalidHighSurrogate", 
				     Integer.toHexString(uuuuu)));
    } // invalidSurrogate(int) 
 
} // class UTF8Reader 
2
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 UTFDataFormatException Methods: