Skip to content

Package: OutputStreamPartVisitor

OutputStreamPartVisitor

nameinstructionbranchcomplexitylinemethod
OutputStreamPartVisitor(OutputStream)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getOutputStream()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
withByte(byte)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
withBytes(byte[])
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
3: * Copyright 2010 Ning, Inc.
4: *
5: * Ning licenses this file to you under the Apache License, version 2.0
6: * (the "License"); you may not use this file except in compliance with the
7: * License. You may obtain a copy of the License at:
8: *
9: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14: * License for the specific language governing permissions and limitations
15: * under the License.
16: */
17:
18: package com.ning.http.client.multipart;
19:
20: import java.io.IOException;
21: import java.io.OutputStream;
22:
23: public class OutputStreamPartVisitor implements PartVisitor {
24:
25: private final OutputStream out;
26:
27: public OutputStreamPartVisitor(OutputStream out) {
28: this.out = out;
29: }
30:
31: @Override
32: public void withBytes(byte[] bytes) throws IOException {
33: out.write(bytes);
34: }
35:
36: @Override
37: public void withByte(byte b) throws IOException {
38: out.write(b);
39: }
40:
41: public OutputStream getOutputStream() {
42: return out;
43: }
44: }