Java Code Examples for org.apache.commons.httpclient.HttpConstants#getBytes()
The following examples show how to use
org.apache.commons.httpclient.HttpConstants#getBytes() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StreamedPostMethod.java From jrpip with Apache License 2.0 | 5 votes |
protected void flushCache() throws IOException { if (this.cachePosition > 0) { this.writeHeaders(); byte[] chunkHeader = HttpConstants.getBytes( Integer.toHexString(this.cachePosition) + "\r\n"); this.stream.write(chunkHeader, 0, chunkHeader.length); this.stream.write(this.cache, 0, this.cachePosition); this.stream.write(ENDCHUNK, 0, ENDCHUNK.length); this.cachePosition = 0; } }
Example 2
Source File: StreamedPostMethod.java From jrpip with Apache License 2.0 | 5 votes |
protected void flushCacheWithAppend(byte[] bufferToAppend, int off, int len) throws IOException { this.writeHeaders(); byte[] chunkHeader = HttpConstants.getBytes( Integer.toHexString(this.cachePosition + len) + "\r\n"); this.stream.write(chunkHeader, 0, chunkHeader.length); this.stream.write(this.cache, 0, this.cachePosition); this.stream.write(bufferToAppend, off, len); this.stream.write(ENDCHUNK, 0, ENDCHUNK.length); this.cachePosition = 0; }