Code example for ByteArrayBuffer

Methods: toByteArray

0
        return document;
    } 
 
    public void parseJsonBuffer() { 
        try { 
            document = CBLServer.getObjectMapper().readValue(jsonBuffer.toByteArray(), Map.class);
        } catch (IOException e) {
            throw new IllegalStateException("Failed to parse json buffer", e);
        } 
        jsonBuffer = null;
    } 
 
    public void setContentType(String contentType) {
        if (!contentType.startsWith("multipart/")) {
            throw new IllegalArgumentException("contentType must start with multipart/");
        } 
        multipartReader = new CBLMultipartReader(contentType, this);
        attachmentsByName = new HashMap<String, CBLBlobStoreWriter>();
        attachmentsByMd5Digest = new HashMap<String, CBLBlobStoreWriter>();
    }