Home
last modified time | relevance | path

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

1234

/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/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/ksoap2/ksoap2-j2se/src/main/java/org/ksoap2/transport/
DHttpTransportSE.java92 public HttpTransportSE(String url, int timeout, int contentLength) { in HttpTransportSE() argument
96 public HttpTransportSE(Proxy proxy, String url, int timeout, int contentLength) { in HttpTransportSE() argument
191 int contentLength = 8192; // To determine the size of the response and adjust buffer size in call() local
210 contentLength = Integer.parseInt(hp.getValue()); in call()
212 contentLength = 8192; in call()
241 if (contentLength > 0) { in call()
244 new BufferedInputStream(connection.openInputStream(), contentLength)); in call()
246 is = new BufferedInputStream(connection.openInputStream(), contentLength); in call()
250 if (contentLength > 0) { in call()
253 new BufferedInputStream(connection.getErrorStream(), contentLength)); in call()
[all …]
/external/okhttp/repackaged/okhttp/src/main/java/com/android/okhttp/
DResponseBody.java44 public abstract long contentLength() throws IOException; in contentLength() method in ResponseBody
53 long contentLength = contentLength(); in bytes() local
54 if (contentLength > Integer.MAX_VALUE) { in bytes()
55 throw new IOException("Cannot buffer entire body for content length: " + contentLength); in bytes()
65 if (contentLength != -1 && contentLength != bytes.length) { in bytes()
124 final MediaType contentType, final long contentLength, final BufferedSource content) { in create() argument
131 @Override public long contentLength() { in create() method in ResponseBody
132 return contentLength; in create()
DMultipartBuilder.java203 private long contentLength = -1L; field in MultipartBuilder.MultipartRequestBody
219 @Override public long contentLength() throws IOException { in contentLength() method in MultipartBuilder.MultipartRequestBody
220 long result = contentLength; in contentLength()
222 return contentLength = writeOrCountBytes(null, true); in contentLength()
263 long contentLength = body.contentLength(); in writeOrCountBytes() local
264 if (contentLength != -1) { in writeOrCountBytes()
266 .writeDecimalLong(contentLength) in writeOrCountBytes()
277 byteCount += contentLength; in writeOrCountBytes()
DRequestBody.java39 public long contentLength() throws IOException { in contentLength() method in RequestBody
70 @Override public long contentLength() throws IOException { in create() method in RequestBody
95 @Override public long contentLength() {
114 @Override public long contentLength() {
/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() {
/external/sl4a/InterpreterForAndroid/src/com/googlecode/android_scripting/
DUrlDownloaderTask.java114 int contentLength = progress[1]; in onProgressUpdate() local
115 if (contentLength == -1) { in onProgressUpdate()
118 mDialog.setMax(contentLength); in onProgressUpdate()
153 int contentLength = connection.getContentLength(); in download() local
155 if (mFile.exists() && contentLength == mFile.length()) { in download()
166 publishProgress(0, contentLength); in download()
169 if (bytesCopied != contentLength && contentLength != -1) { in download()
170 throw new IOException("Download incomplete: " + bytesCopied + " != " + contentLength); in download()
/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()
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()
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()
/external/nanohttpd/core/src/test/java/fi/iki/elonen/
DHttpPostRequestTest.java80 …int contentLength = size + contentLengthHeaderValueSize + HttpPostRequestTest.CONTENT_LENGTH.lengt… in preparePostWithMultipartForm() local
81 …String input = header + HttpPostRequestTest.CONTENT_LENGTH + (contentLength + 5) + "\r\n\r\n" + co… in preparePostWithMultipartForm()
125 …int contentLength = size + contentLengthHeaderValueSize + HttpPostRequestTest.CONTENT_LENGTH.lengt… in testPostWithMultipleMultipartFormFields() local
126 …String input = header + HttpPostRequestTest.CONTENT_LENGTH + (contentLength + 4) + "\r\n\r\n" + co… in testPostWithMultipleMultipartFormFields()
144 …int contentLength = size + contentLengthHeaderValueSize + HttpPostRequestTest.CONTENT_LENGTH.lengt… in testPostWithMultipleMultipartFormFieldsWhereContentTypeWasSeparatedByComma() local
145 …String input = header + HttpPostRequestTest.CONTENT_LENGTH + (contentLength + 4) + "\r\n\r\n" + co… in testPostWithMultipleMultipartFormFieldsWhereContentTypeWasSeparatedByComma()
162 …int contentLength = size + contentLengthHeaderValueSize + HttpPostRequestTest.CONTENT_LENGTH.lengt… in testSimplePostWithSingleMultipartFormField() local
163 …String input = header + HttpPostRequestTest.CONTENT_LENGTH + (contentLength + 4) + "\r\n\r\n" + co… in testSimplePostWithSingleMultipartFormField()
176 …int contentLength = size + contentLengthHeaderValueSize + HttpPostRequestTest.CONTENT_LENGTH.lengt… in testSimpleRawPostData() local
177 …String input = header + HttpPostRequestTest.CONTENT_LENGTH + (contentLength + 4) + "\r\n\r\n" + co… in testSimpleRawPostData()
/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.java38 assertEquals(3, body.contentLength()); in string()
47 assertEquals(3, body.contentLength()); in stringWithDefaultCharsetAdded()
55 assertEquals(2, body.contentLength()); in stringWithNonDefaultCharsetSpecified()
63 assertEquals(3, body.contentLength()); in byteArray()
72 assertEquals(3, body.contentLength()); in byteArrayRange()
86 assertEquals(3, body.contentLength()); in file()
106 assertEquals(0L, delete.body().contentLength()); in crudVerbs()
/external/volley/src/main/java/com/android/volley/toolbox/
DAdaptedHttpStack.java67 long contentLength = apacheResp.getEntity().getContentLength(); in executeRequest() local
68 if ((int) contentLength != contentLength) { in executeRequest()
69 throw new IOException("Response too large: " + contentLength); in executeRequest()
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/http/
DHttp1xStream.java87 @Override public Sink createRequestBody(Request request, long contentLength) throws IOException { in createRequestBody() argument
93 if (contentLength != -1) { in createRequestBody()
95 return newFixedLengthSink(contentLength); in createRequestBody()
144 long contentLength = OkHeaders.contentLength(response); in getTransferStream() local
145 if (contentLength != -1) { in getTransferStream()
146 return newFixedLengthSource(contentLength); in getTransferStream()
223 public Sink newFixedLengthSink(long contentLength) { in newFixedLengthSink() argument
226 return new FixedLengthSink(contentLength); in newFixedLengthSink()
DHttpEngine.java98 @Override public long contentLength() {
232 long contentLength = OkHeaders.contentLength(request); in sendRequest() local
234 if (contentLength > Integer.MAX_VALUE) { in sendRequest()
239 if (contentLength != -1) { in sendRequest()
242 requestBodyOut = new RetryableSink((int) contentLength); in sendRequest()
251 requestBodyOut = httpStream.createRequestBody(networkRequest, contentLength); in sendRequest()
504 if (OkHeaders.contentLength(response) != -1 in hasBody()
586 if (OkHeaders.contentLength(networkRequest) == -1 in readResponse()
588 long contentLength = ((RetryableSink) requestBodyOut).contentLength(); in readResponse() local
590 .header("Content-Length", Long.toString(contentLength)) in readResponse()
[all …]
/external/okhttp/okhttp-logging-interceptor/src/main/java/com/squareup/okhttp/logging/
DHttpLoggingInterceptor.java156 requestStartMessage += " (" + requestBody.contentLength() + "-byte body)"; in intercept()
167 if (requestBody.contentLength() != -1) { in intercept()
168 logger.log("Content-Length: " + requestBody.contentLength()); in intercept()
199 + " (" + requestBody.contentLength() + "-byte body)"); in intercept()
210 + (!logHeaders ? ", " + responseBody.contentLength() + "-byte body" : "") + ')'); in intercept()
233 if (responseBody.contentLength() != 0) { in intercept()
/external/okhttp/repackaged/okhttp/src/main/java/com/android/okhttp/internal/http/
DHttp1xStream.java89 @Override public Sink createRequestBody(Request request, long contentLength) throws IOException { in createRequestBody() argument
95 if (contentLength != -1) { in createRequestBody()
97 return newFixedLengthSink(contentLength); in createRequestBody()
146 long contentLength = OkHeaders.contentLength(response); in getTransferStream() local
147 if (contentLength != -1) { in getTransferStream()
148 return newFixedLengthSource(contentLength); in getTransferStream()
225 public Sink newFixedLengthSink(long contentLength) { in newFixedLengthSink() argument
228 return new FixedLengthSink(contentLength); in newFixedLengthSink()
DHttpEngine.java100 @Override public long contentLength() {
240 long contentLength = OkHeaders.contentLength(request); in sendRequest() local
242 if (contentLength > Integer.MAX_VALUE) { in sendRequest()
247 if (contentLength != -1) { in sendRequest()
250 requestBodyOut = new RetryableSink((int) contentLength); in sendRequest()
259 requestBodyOut = httpStream.createRequestBody(networkRequest, contentLength); in sendRequest()
515 if (OkHeaders.contentLength(response) != -1 in hasBody()
599 if (OkHeaders.contentLength(networkRequest) == -1 in readResponse()
601 long contentLength = ((RetryableSink) requestBodyOut).contentLength(); in readResponse() local
603 .header("Content-Length", Long.toString(contentLength)) in readResponse()
[all …]
/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()

1234