Home
last modified time | relevance | path

Searched refs:contentLength (Results 1 – 25 of 71) sorted by relevance

123

/external/nist-sip/java/gov/nist/javax/sip/header/
DContentLength.java86 protected Integer contentLength; field in ContentLength
100 this.contentLength = Integer.valueOf(length); in ContentLength()
108 return contentLength.intValue(); in getContentLength()
115 public void setContentLength(int contentLength) in setContentLength() argument
117 if (contentLength < 0) in setContentLength()
121 this.contentLength = Integer.valueOf(contentLength); in setContentLength()
133 if (contentLength == null) in encodeBody()
136 buffer.append(contentLength.toString()); in encodeBody()
/external/apache-http/src/org/apache/http/impl/io/
DContentLengthInputStream.java83 private long contentLength; field in ContentLengthInputStream
103 public ContentLengthInputStream(final SessionInputBuffer in, long contentLength) { in ContentLengthInputStream() argument
108 if (contentLength < 0) { in ContentLengthInputStream()
112 this.contentLength = contentLength; in ContentLengthInputStream()
148 if (pos >= contentLength) { in read()
172 if (pos >= contentLength) { in read()
176 if (pos + len > contentLength) { in read()
177 len = (int) (contentLength - pos); in read()
211 long remaining = Math.min(n, this.contentLength - this.pos); in skip()
DContentLengthOutputStream.java64 private final long contentLength; field in ContentLengthOutputStream
81 public ContentLengthOutputStream(final SessionOutputBuffer out, long contentLength) { in ContentLengthOutputStream() argument
86 if (contentLength < 0) { in ContentLengthOutputStream()
90 this.contentLength = contentLength; in ContentLengthOutputStream()
113 if (this.total < this.contentLength) { in write()
114 long max = this.contentLength - this.total; in write()
131 if (this.total < this.contentLength) { in write()
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/
DResponseBody.java40 public abstract long contentLength() throws IOException; in contentLength() method in ResponseBody
49 long contentLength = contentLength(); in bytes() local
50 if (contentLength > Integer.MAX_VALUE) { in bytes()
51 throw new IOException("Cannot buffer entire body for content length: " + contentLength); in bytes()
61 if (contentLength != -1 && contentLength != bytes.length) { in bytes()
120 final MediaType contentType, final long contentLength, final BufferedSource content) { in create() argument
127 @Override public long contentLength() { in create() method in ResponseBody
128 return contentLength; in create()
DMultipartBuilder.java201 private long contentLength = -1L; field in MultipartBuilder.MultipartRequestBody
217 @Override public long contentLength() throws IOException { in contentLength() method in MultipartBuilder.MultipartRequestBody
218 long result = contentLength; in contentLength()
220 return contentLength = writeOrCountBytes(null, true); in contentLength()
261 long contentLength = body.contentLength(); in writeOrCountBytes() local
262 if (contentLength != -1) { in writeOrCountBytes()
264 .writeDecimalLong(contentLength) in writeOrCountBytes()
275 byteCount += contentLength; in writeOrCountBytes()
DRequestBody.java35 public long contentLength() throws IOException { in contentLength() method in RequestBody
66 @Override public long contentLength() throws IOException { in create() method in RequestBody
91 @Override public long contentLength() {
110 @Override public long contentLength() {
DCache.java640 String contentLength = responseHeaders.get("Content-Length"); in response() local
652 .body(new CacheResponseBody(snapshot, contentType, contentLength)) in response()
675 private final String contentLength; field in CacheResponseBody
678 String contentType, String contentLength) { in CacheResponseBody() argument
681 this.contentLength = contentLength; in CacheResponseBody()
696 @Override public long contentLength() { in contentLength() method in CacheResponseBody
698 return contentLength != null ? Long.parseLong(contentLength) : -1; in contentLength()
DCall.java250 long contentLength = body.contentLength(); in getResponse() local
251 if (contentLength != -1) { in getResponse()
252 requestBuilder.header("Content-Length", Long.toString(contentLength)); in getResponse()
/external/nist-sip/java/gov/nist/javax/sip/parser/
DPipelinedMsgParser.java294 int contentLength = 0; in run() local
296 contentLength = cl.getContentLength(); in run()
298 contentLength = 0; in run()
302 Debug.println("contentLength " + contentLength); in run()
305 if (contentLength == 0) { in run()
308 || contentLength < this.sizeCounter) { in run()
309 byte[] message_body = new byte[contentLength]; in run()
311 while (nread < contentLength) { in run()
322 nread, contentLength - nread); in run()
DContentLengthParser.java44 public ContentLengthParser(String contentLength) { in ContentLengthParser() argument
45 super(contentLength); in ContentLengthParser()
56 ContentLength contentLength = new ContentLength(); in parse() local
59 contentLength.setContentLength(Integer.parseInt(number)); in parse()
62 return contentLength; in parse()
DMaxForwardsParser.java43 public MaxForwardsParser(String contentLength) { in MaxForwardsParser() argument
44 super(contentLength); in MaxForwardsParser()
55 MaxForwards contentLength = new MaxForwards(); in parse() local
58 contentLength.setMaxForwards(Integer.parseInt(number)); in parse()
61 return contentLength; in parse()
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/http/
DHttpTransport.java36 @Override public Sink createRequestBody(Request request, long contentLength) throws IOException { in createRequestBody() argument
42 if (contentLength != -1) { in createRequestBody()
44 return httpConnection.newFixedLengthSink(contentLength); in createRequestBody()
123 long contentLength = OkHeaders.contentLength(response); in getTransferStream() local
124 if (contentLength != -1) { in getTransferStream()
125 return httpConnection.newFixedLengthSource(contentLength); in getTransferStream()
DHttpEngine.java106 @Override public long contentLength() {
258 long contentLength = OkHeaders.contentLength(request); in sendRequest() local
260 if (contentLength > Integer.MAX_VALUE) { in sendRequest()
265 if (contentLength != -1) { in sendRequest()
268 requestBodyOut = new RetryableSink((int) contentLength); in sendRequest()
277 requestBodyOut = transport.createRequestBody(networkRequest, contentLength); in sendRequest()
676 if (OkHeaders.contentLength(response) != -1 in hasBody()
765 if (OkHeaders.contentLength(networkRequest) == -1 in readResponse()
767 long contentLength = ((RetryableSink) requestBodyOut).contentLength(); in readResponse() local
769 .header("Content-Length", Long.toString(contentLength)) in readResponse()
[all …]
DRealResponseBody.java37 @Override public long contentLength() { in contentLength() method in RealResponseBody
38 return OkHeaders.contentLength(headers); in contentLength()
DSocketConnector.java188 long contentLength = OkHeaders.contentLength(response); in createTunnel() local
189 if (contentLength == -1L) { in createTunnel()
190 contentLength = 0L; in createTunnel()
192 Source body = tunnelConnection.newFixedLengthSource(contentLength); in createTunnel()
DOkHeaders.java61 public static long contentLength(Request request) { in contentLength() method in OkHeaders
62 return contentLength(request.headers()); in contentLength()
65 public static long contentLength(Response response) { in contentLength() method in OkHeaders
66 return contentLength(response.headers()); in contentLength()
69 public static long contentLength(Headers headers) { in contentLength() method in OkHeaders
/external/nanohttpd/core/src/test/java/fi/iki/elonen/
DHttpPostRequestTest.java30 int contentLength = size + contentLengthHeaderValueSize + CONTENT_LENGTH.length(); in testSimpleRawPostData() local
31 String input = header + CONTENT_LENGTH + (contentLength+4) + "\r\n\r\n" + content; in testSimpleRawPostData()
50 int contentLength = size + contentLengthHeaderValueSize + CONTENT_LENGTH.length(); in testSimplePostWithSingleMultipartFormField() local
51 String input = header + CONTENT_LENGTH + (contentLength+4) + "\r\n\r\n" + content; in testSimplePostWithSingleMultipartFormField()
73 int contentLength = size + contentLengthHeaderValueSize + CONTENT_LENGTH.length(); in testPostWithMultipleMultipartFormFields() local
74 String input = header + CONTENT_LENGTH + (contentLength+4) + "\r\n\r\n" + content; in testPostWithMultipleMultipartFormFields()
97 int contentLength = size + contentLengthHeaderValueSize + CONTENT_LENGTH.length(); in testPostWithMultipleMultipartFormFieldsWhereContentTypeWasSeparatedByComma() local
98 String input = header + CONTENT_LENGTH + (contentLength+4) + "\r\n\r\n" + content; in testPostWithMultipleMultipartFormFieldsWhereContentTypeWasSeparatedByComma()
151 int contentLength = size + contentLengthHeaderValueSize + CONTENT_LENGTH.length(); in preparePostWithMultipartForm() local
152 String input = header + CONTENT_LENGTH + (contentLength+5) + "\r\n\r\n" + content; in preparePostWithMultipartForm()
/external/okhttp/samples/guide/src/main/java/com/squareup/okhttp/recipes/
DProgress.java41 @Override public void update(long bytesRead, long contentLength, boolean done) { in run()
43 System.out.println(contentLength); in run()
45 System.out.format("%d%% done\n", (100 * bytesRead) / contentLength); in run()
83 @Override public long contentLength() throws IOException { in contentLength() method in Progress.ProgressResponseBody
84 return responseBody.contentLength(); in contentLength()
101 progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); in source()
109 void update(long bytesRead, long contentLength, boolean done); in update() argument
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/
DMultipartBuilderTest.java49 assertEquals(53, requestBody.contentLength()); in singlePart()
50 assertEquals(buffer.size(), requestBody.contentLength()); in singlePart()
80 assertEquals(112, requestBody.contentLength()); in threeParts()
81 assertEquals(buffer.size(), requestBody.contentLength()); in threeParts()
137 assertEquals(568, requestBody.contentLength()); in fieldAndTwoFiles()
138 assertEquals(buffer.size(), requestBody.contentLength()); in fieldAndTwoFiles()
223 assertEquals(-1, requestBody.contentLength()); in streamingPartHasNoLength()
DRequestTest.java37 assertEquals(3, body.contentLength()); in string()
46 assertEquals(3, body.contentLength()); in stringWithDefaultCharsetAdded()
54 assertEquals(2, body.contentLength()); in stringWithNonDefaultCharsetSpecified()
62 assertEquals(3, body.contentLength()); in byteArray()
71 assertEquals(3, body.contentLength()); in byteArrayRange()
85 assertEquals(3, body.contentLength()); in file()
105 assertEquals(0L, delete.body().contentLength()); in crudVerbs()
DFormEncodingBuilderTest.java33 assertEquals(expected.length(), formEncoding.contentLength()); in urlEncoding()
46 assertEquals(expected.length(), formEncoding.contentLength()); in encodedPair()
61 assertEquals(expected.length(), formEncoding.contentLength()); in encodeMultiplePairs()
/external/oauth/core/src/main/java/net/oauth/client/
DURLConnectionClient.java73 String contentLength = null; in execute() local
78 contentLength = header.getValue(); in execute()
88 if (contentLength != null) { in execute()
90 .setFixedLengthStreamingMode(Integer.parseInt(contentLength)); in execute()
/external/nanohttpd/core/src/test/java/fi/iki/elonen/integration/
DPutStreamIntegrationTest.java50 int contentLength = Integer.parseInt(headers.get("content-length")); in serve() local
55 body = new byte[contentLength]; in serve()
56 dataInputStream.readFully(body, 0, contentLength); in serve()
/external/okhttp/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/huc/
DHttpsURLConnectionImpl.java72 @Override public void setFixedLengthStreamingMode(long contentLength) { in setFixedLengthStreamingMode() argument
73 delegate.setFixedLengthStreamingMode(contentLength); in setFixedLengthStreamingMode()
/external/oauth/core/src/main/java/net/oauth/client/httpclient4/
DHttpMethodResponse.java109 long contentLength = r.getEntity().getContentLength(); in dump() local
110 if (contentLength >= 0) { in dump()
111 request.append("Content-Length: ").append(contentLength).append(EOL); in dump()

123