MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / ByteData

Class ByteData

CodenameOne/src/com/codename1/io/Data.java:144–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected