Beispiel #1
0
 public byte[] getJPEG() {
   if (isFake) {
     int length = fakeCamera.getJPEG(readBuffer, 4);
     System.arraycopy(
         getIntBytes(length), 0, readBuffer, 0, 4); // copy length to 4 first bytes in buffer
   } else {
     int length = realCamera.getJPEG(readBuffer, 4);
     System.arraycopy(
         getIntBytes(length), 0, readBuffer, 0, 4); // copy length to 4 first bytes in buffer
   }
   byte[] buffer = new byte[se.lth.cs.fakecamera.Axis211A.IMAGE_BUFFER_SIZE + 4];
   System.arraycopy(readBuffer, 0, buffer, 0, readBuffer.length);
   return buffer;
 }
Beispiel #2
0
 public void close() {
   if (isFake) fakeCamera.close();
   else realCamera.close();
 }
Beispiel #3
0
 public boolean connect() {
   if (isFake) return fakeCamera.connect();
   else return realCamera.connect();
 }