Code example for PushbackReader

Methods: read, unread

0
            } 
        } 
    } 
     
    public void endRecord(String tag) throws IOException {
        char c = (char) stream.read();
        if (tag == null || "".equals(tag)) {
            if (c != '\n' && c != '\r') {
                throw new IOException("Error deserializing record.");
            } else { 
                return; 
            } 
        } 
         
        if (c != '}') {
            throw new IOException("Error deserializing "+tag);
        } 
        c = (char) stream.read();
        if (c != ',') {
            stream.unread(c);
        } 
         
        return; 
    }