| 142 | /// Wraps a byte[] array as a Data object. |
| 143 | /// |
| 144 | class ByteData implements Data { |
| 145 | private final byte[] bytes; |
| 146 | |
| 147 | |
| 148 | /// Creates a new Data object that wraps a byte array. |
| 149 | /// |
| 150 | /// #### Parameters |
| 151 | /// |
| 152 | /// - `bytes` |
| 153 | public ByteData(byte[] bytes) { |
| 154 | this.bytes = bytes; |
| 155 | } |
| 156 | |
| 157 | /// {@inheritDoc } |
| 158 | @Override |
| 159 | public void appendTo(OutputStream output) throws IOException { |
| 160 | output.write(bytes); |
| 161 | } |
| 162 | |
| 163 | /// {@inheritDoc } |
| 164 | @Override |
| 165 | public long getSize() throws IOException { |
| 166 | return bytes.length; |
| 167 | } |
| 168 | } |
| 169 | } |
nothing calls this directly
no outgoing calls
no test coverage detected