code: private static void svdlibcSparseBinaryToMatlab(File input, File output,
                                                      boolean transpose) 
              throws IOException {
          
          DataInputStream dis = new DataInputStream(
              new BufferedInputStream(new FileInputStream(input)));
  
          PrintWriter pw = new PrintWriter(output);
  
          int rows = dis.readInt();
          int cols = dis.readInt();
          int entries = dis.readInt();
  
          // SVDLIBC sparse binary is organized as column data.  
          int entriesSeen = 0;
          int col = 0;
          for (; entriesSeen < entries; ++col) {
              int nonZero = dis.readInt();
  
              for (int i = 0; i < nonZero; ++i, ++entriesSeen) {
                  int row = dis.readInt();
                  float val = dis.readFloat();
                  if (transpose)
                      pw.println((1 + col) + " " + (1 + row) + " " + val);
                  else
                      pw.println((1 + row) + " " + (1 + col) + " " + val);
              }
          }
          
          dis.close();
          pw.close();
      }
docs: Reads in a matrix in the {@link Format#SVDLIBC_SPARSE_BINARY} format and
  writes it to the output file in the {@link Format#MATLAB_SPARSE} format.