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

This code example shows how to use the following methods:getCause, getLocalizedMessage, getMessage
     
    /** 
     *@tests {@link java.nio.InvalidMarkException#InvalidMarkException()} 
     */ 
    public void test_Constructor() { 
        InvalidMarkException exception = new InvalidMarkException();
        assertNull(exception.getMessage());
        assertNull(exception.getLocalizedMessage());
        assertNull(exception.getCause());
    } 
} 
6
CodeRank
This code example shows how to use the following methods:
	} 
 
	@Override 
	public void reset() { 
		if (mark < 0)
		    throw new InvalidMarkException();
		nextGet = mark;
		calculateLength(); 
		if(nextGet >= buf.length)
			throw new IllegalStateException("bug, nextget is same or greater than buflength="+buf.length+" nextget="+nextGet);
	} 
 
	public void discardBytes(int bytes) {
		if(bytes > length)
			throw new IllegalStateException("length="+length+" so numbytes of="+bytes+" cannot be discarded");
		else if(bytes < 0)
			throw new IllegalArgumentException("cannot discard negative byte count");
		 
		if(nextPut > nextGet || buf.length-nextGet > bytes) {
			nextGet+=bytes;
5
CodeRank
This code example shows how to use the following methods:
 
    @Override 
    public final HeapBuffer reset() { 
        int m = mark;
        if (m < 0)
            throw new InvalidMarkException();
        pos = m;
        return this;
    } 
 
    @Override 
    public final HeapBuffer clear() { 
        pos = 0;
        lim = cap;
        mark = -1;
        return this;
    } 
 
    @Override 
    public final HeapBuffer flip() { 
2
CodeRank
See Code Examples for Java 8 InvalidMarkException Methods: