本文整理了Java中okio.Buffer.close()
方法的一些代码示例,展示了Buffer.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.close()
方法的具体详情如下:
包路径:okio.Buffer
类名称:Buffer
方法名:close
暂无
代码示例来源:origin: mrmike/Ok2Curl
@Override
public void close() throws IOException {
limited.close();
}
}
代码示例来源:origin: Nextdoor/bender
@Override
public void close() {
buffer.close();
}
代码示例来源:origin: Nextdoor/bender
@Override
public void close() {
buffer.close();
}
代码示例来源:origin: com.burgstaller/okhttp-digest
@Override
public void close() throws IOException {
if (this.closed) {
return;
}
this.closed = true;
this.digest = this.digester.digest();
buffer.close();
}
代码示例来源:origin: rburgst/okhttp-digest
@Override
public void close() throws IOException {
if (this.closed) {
return;
}
this.closed = true;
this.digest = this.digester.digest();
buffer.close();
}
代码示例来源:origin: com.abubusoft/kripton-retrofit-converter
@Override
public RequestBody convert(T value) throws IOException {
Buffer buffer = new Buffer();
try {
binderContext.serialize(value, buffer.outputStream());
return RequestBody.create(MEDIA_TYPE, buffer.readByteString());
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
buffer.close();
}
}
}
代码示例来源:origin: com.abubusoft/kripton-retrofit-converter
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public RequestBody convert(T value) throws IOException {
Buffer buffer = new Buffer();
try {
binderContext.serializeCollection((Collection) value, (Class)clazz,buffer.outputStream());
return RequestBody.create(MEDIA_TYPE, buffer.readByteString());
} catch (Exception e) {
e.printStackTrace();
return null;
} finally
{
buffer.close();
}
}
}
代码示例来源:origin: xcesco/kripton
@Override
public RequestBody convert(T value) throws IOException {
Buffer buffer = new Buffer();
try {
binderContext.serialize(value, buffer.outputStream());
return RequestBody.create(MEDIA_TYPE, buffer.readByteString());
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
buffer.close();
}
}
}
代码示例来源:origin: xcesco/kripton
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public RequestBody convert(T value) throws IOException {
Buffer buffer = new Buffer();
try {
binderContext.serializeCollection((Collection)value, beanClazz,buffer.outputStream());
return RequestBody.create(MEDIA_TYPE, buffer.readByteString());
} catch (Exception e) {
e.printStackTrace();
return null;
} finally
{
buffer.close();
}
}
}
代码示例来源:origin: com.abubusoft/kripton-retrofit-converter
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public RequestBody convert(T value) throws IOException {
Buffer buffer = new Buffer();
try {
binderContext.serializeCollection((Collection)value, beanClazz,buffer.outputStream());
return RequestBody.create(MEDIA_TYPE, buffer.readByteString());
} catch (Exception e) {
e.printStackTrace();
return null;
} finally
{
buffer.close();
}
}
}
代码示例来源:origin: xcesco/kripton
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public RequestBody convert(T value) throws IOException {
Buffer buffer = new Buffer();
try {
binderContext.serializeCollection((Collection) value, (Class)clazz,buffer.outputStream());
return RequestBody.create(MEDIA_TYPE, buffer.readByteString());
} catch (Exception e) {
e.printStackTrace();
return null;
} finally
{
buffer.close();
}
}
}
代码示例来源:origin: VictorAlbertos/Mockery
/**
* Deserialize the content of a {@code RequestBody} as the DTO object and defer to its mockery to perform the validation.
* @see DTO.Behaviour
*/
@Override public void validate(Metadata<RequestBodyDTO> metadata, Object candidate) throws AssertionError {
if (candidate == null) {
dtoJsonMockery.validate(DTOJsonMetadata(metadata), candidate);
}
try {
RequestBody requestBody = (RequestBody) candidate;
Buffer buffer = new Buffer();
requestBody.writeTo(buffer);
String body = buffer.readUtf8();
buffer.close();
dtoJsonMockery.validate(DTOJsonMetadata(metadata), body);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: auth0/auth0-java
public static Map<String, Object> bodyFromRequest(RecordedRequest request) throws IOException {
ObjectMapper mapper = new ObjectMapper();
MapType mapType = mapper.getTypeFactory().constructMapType(HashMap.class, String.class, Object.class);
Buffer body = request.getBody();
try {
return mapper.readValue(body.inputStream(), mapType);
} catch (IOException e) {
throw e;
} finally {
body.close();
}
}
}
代码示例来源:origin: blockchain/unused-My-Wallet-V3-jar
@SuppressWarnings("TryFinallyCanBeTryWithResources")
private String requestBodyToString(final RequestBody request) {
final Buffer buffer = new Buffer();
try {
if (request != null) {
request.writeTo(buffer);
return buffer.readUtf8();
} else {
return "";
}
} catch (final IOException e) {
return "IOException reading request body";
} finally {
buffer.close();
}
}
}
代码示例来源:origin: com.squareup.okhttp/mockwebserver
body.close();
内容来源于网络,如有侵权,请联系作者删除!