Skip to content

Instantly share code, notes, and snippets.

@miguelcardo
Created November 27, 2014 15:44
Show Gist options
  • Save miguelcardo/e9c08167c2cb68aa7bdc to your computer and use it in GitHub Desktop.
Save miguelcardo/e9c08167c2cb68aa7bdc to your computer and use it in GitHub Desktop.
Encode sector and block in JSON
// Returns JSON encoding of a block (inside a sector) to be read
public static JSONObject encodeBlockToRead(int numSector, int numBlock) {
JSONObject block = new JSONObject();
block.put ("sector", numSector);
block.put ("block", numBlock);
return block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment