本文整理汇总了Java中org.apache.http.io.SessionInputBuffer.readLine方法的典型用法代码示例。如果您正苦于以下问题:Java SessionInputBuffer.readLine方法的具体用法?Java SessionInputBuffer.readLine怎么用?Java SessionInputBuffer.readLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.http.io.SessionInputBuffer
的用法示例。
在下文中一共展示了SessionInputBuffer.readLine方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseHead
import org.apache.http.io.SessionInputBuffer; //导入方法依赖的package包/类
@Override
protected HttpMessage parseHead(
final SessionInputBuffer sessionBuffer)
throws IOException, HttpException, ParseException {
this.lineBuf.clear();
int i = sessionBuffer.readLine(this.lineBuf);
if (i == -1) {
throw new NoHttpResponseException("The target server failed to respond");
}
//create the status line from the status string
ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor);
return this.responseFactory.newHttpResponse(statusline, null);
}
示例2: parseHead
import org.apache.http.io.SessionInputBuffer; //导入方法依赖的package包/类
@Override
protected HttpResponse parseHead(
final SessionInputBuffer sessionBuffer)
throws IOException, HttpException, ParseException {
this.lineBuf.clear();
int i = sessionBuffer.readLine(this.lineBuf);
if (i == -1) {
throw new NoHttpResponseException("The target server failed to respond");
}
//create the status line from the status string
ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor);
return this.responseFactory.newHttpResponse(statusline, null);
}
示例3: parseHead
import org.apache.http.io.SessionInputBuffer; //导入方法依赖的package包/类
@Override
protected HttpRequest parseHead(
final SessionInputBuffer sessionBuffer)
throws IOException, HttpException, ParseException {
this.lineBuf.clear();
int i = sessionBuffer.readLine(this.lineBuf);
if (i == -1) {
throw new ConnectionClosedException("Client closed connection");
}
ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor);
return this.requestFactory.newHttpRequest(requestline);
}
示例4: parseHead
import org.apache.http.io.SessionInputBuffer; //导入方法依赖的package包/类
@Override
protected HttpMessage parseHead(
final SessionInputBuffer sessionBuffer)
throws IOException, HttpException, ParseException {
this.lineBuf.clear();
int i = sessionBuffer.readLine(this.lineBuf);
if (i == -1) {
throw new ConnectionClosedException("Client closed connection");
}
ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor);
return this.requestFactory.newHttpRequest(requestline);
}
示例5: readCRLFSeparatedBlock
import org.apache.http.io.SessionInputBuffer; //导入方法依赖的package包/类
public static String[] readCRLFSeparatedBlock(SessionInputBuffer input) throws IOException {
CharArrayBuffer line = new CharArrayBuffer(128);
List<String> ret = new ArrayList<>();
for (;;) {
if (input.readLine(line) == -1) break;
if (line.length() == 0) break;
ret.add(line.toString());
line.clear();
}
return ret.toArray(new String[ret.size()]);
}
示例6: parseHead
import org.apache.http.io.SessionInputBuffer; //导入方法依赖的package包/类
@Override
protected HttpResponse parseHead(
final SessionInputBuffer sessionBuffer)
throws IOException, HttpException, ParseException {
this.lineBuf.clear();
final int i = sessionBuffer.readLine(this.lineBuf);
if (i == -1) {
throw new NoHttpResponseException("The target server failed to respond");
}
//create the status line from the status string
final ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
final StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor);
return this.responseFactory.newHttpResponse(statusline, null);
}
示例7: parseHead
import org.apache.http.io.SessionInputBuffer; //导入方法依赖的package包/类
@Override
protected HttpRequest parseHead(
final SessionInputBuffer sessionBuffer)
throws IOException, HttpException, ParseException {
this.lineBuf.clear();
final int i = sessionBuffer.readLine(this.lineBuf);
if (i == -1) {
throw new ConnectionClosedException("Client closed connection");
}
final ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
final RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor);
return this.requestFactory.newHttpRequest(requestline);
}