Guest User

Untitled

a guest
Jan 23rd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. DatastoreService datastoreService = DatastoreServiceFactory.getDatastoreService();
  2.                
  3.                  
  4.        
  5.         BlobInfoFactory blobInfoFactory = new BlobInfoFactory(datastoreService);
  6.         BlobInfo hi2 = blobInfoFactory.loadBlobInfo(blobKey);
  7.  
  8.         Long fileSize = hi2.getSize();
  9.         Integer times = (int) ((fileSize + 1000000 -1) / 1000000);
  10.                
  11.                        
  12.                        
  13.        
  14.         long idv3 = fileSize - 128;
  15.        
  16.         long titleFirst = fileSize - 125;
  17.         long titleLast = fileSize - 96;
  18.        
  19.         long albumFirst = fileSize - 65;
  20.         long albumLast = fileSize - 36;
  21.        
  22.         long artistFirst = fileSize - 95;
  23.         long artistLast = fileSize - 66;
  24.                        
  25.    
  26.         byte [] titleArray = blobstoreService.fetchData(blobKey, titleFirst, titleLast);
  27.         byte [] albumArray = blobstoreService.fetchData(blobKey, albumFirst, albumLast);
  28.         byte [] artistArray = blobstoreService.fetchData(blobKey, artistFirst, artistLast);
  29.              
  30.        
  31.         String title = new String(titleArray);
  32.         String album = new String(albumArray);
  33.         String artist = new String(artistArray);
  34.        
  35.        
  36.         title = title.replaceAll("\\p{Cntrl}", "");  
  37.         album = album.replaceAll("\\p{Cntrl}", "");  
  38.         artist = artist.replaceAll("\\p{Cntrl}", "");
Add Comment
Please, Sign In to add comment