Advertisement
Guest User

Untitled

a guest
Nov 27th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. public class VideoDataModel{
  2.     private int width;
  3.     private int height;
  4.     private byte fps;
  5. }
  6.  
  7. InputStream inputStream = new FileInputStream(file);
  8. byte[] rawData = new byte[9]; // 4 + 4 + 1
  9. inputStream.read(rawData);
  10.  
  11. VideoDataModel videoDataModel = new VideoDataModel();
  12. byte[] heightArray = {rawData[0], rawData[1], rawData[2], rawData[3]};
  13. byte[] widthArray = {rawData[4], rawData[5], rawData[6], rawData[7]};
  14. int width = new BigInteger(widthArray).intValue();
  15. int height = new BigInteger(heightArray).intValue();
  16.  
  17. videoDataModel.setWidth(width);
  18. videoDataModel.setHeight(height);
  19. videoDataModel.setFps(rawData[8]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement