Popular Posts
JSRequest, Get parameters from querystring with javascript in SharePoint Provides method to parse query string, filename, and pathname from URL // Initialize first JSRequest.EnsureSetup(); // Get the current fil... SwiXml - Layout BorderLayout BorderLayoutPane.xml <?xml version="1.0" encoding="UTF-8"?> <panel layout="BorderLayout... Export list schema from sharepoint http:// YOUR_SERVER_URL / PATH_TO_SITE_CONTAINING_LIST /_vti_bin/owssvr.dll?Cmd=ExportList&List= {YOUR_LIST_GUID}
Stats
StreamReader
package bruce.lib.io;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @author Bruce Tsai
 * 
 */
public class StreamReader {

    private InputStream stream;
    public String encoding;

    /**
     * @param stream
     */
    public StreamReader(InputStream stream) {
        this.stream = stream;
    }

    /**
     * @param stream
     * @param encoding
     */
    public StreamReader(InputStream stream, String encoding) {
        this.stream = stream;
        this.encoding = encoding;
    }

    /**
     * @return
     * @throws IOException
     */
    public String readAllText() throws IOException {
        return this.encoding == null || this.encoding.length() == 0 ? new String(readAllBytes()) : new String(readAllBytes(), this.encoding);
    }

    /**
     * @return
     * @throws IOException
     */
    public byte[] readAllBytes() throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        byte[] buffer = new byte[128];
        int readed = -1;
        while ((readed = this.stream.read(buffer)) > -1) {
            baos.write(buffer, 0, readed);
        }
        baos.close();
        this.stream.close();
        return baos.toByteArray();
    }
}