Code example for ByteArrayBuffer

Methods: append

0
    public void appendData(byte[] data) {
        if (multipartReader != null) {
            multipartReader.appendData(data);
        } 
        else { 
            jsonBuffer.append(data, 0, data.length);
        } 
    } 
 
    public void finish() { 
        if (multipartReader != null) {
            if (!multipartReader.finished()) {
                throw new IllegalStateException("received incomplete MIME multipart response");
            } 
 
            registerAttachments(); 
        } 
        else { 
            parseJsonBuffer(); 
        } 
    }