I am creating a temperature server which allows the client to ask for a temperature via typing a city. I am using a hashmap. I need help in getting the server to display the temperature. I am currently using an OutputStream but i think i need to use an ObjectStream, any ideas? Below is the current code for the temperatureClient and temperatureServer.

Temperature client

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class TemperatureClient {
public static final int PORT = 1234;


/**
* @param args
*/
public static void main(String[] args) {
InetAddress HOST;
try {
HOST = InetAddress.getLocalHost();
Socket client = new Socket(HOST, PORT);
BufferedReader serverMsg = new BufferedReader(new InputStreamReader(
client.getInputStream()));
BufferedReader userInput = new BufferedReader(new InputStreamReader(System.in));
PrintWriter output = new PrintWriter(client.getOutputStream(),
true);
String currentMsg = "";
System.out.println("Ask for a temperature in a particular server, type 'quit' to exit the program");
while(true) {
System.out.print(">> ");
currentMsg = userInput.readLine();
output.println(currentMsg);
if(currentMsg.equalsIgnoreCase("quit")) {
System.out.println("Exiting temperature client..");
serverMsg.close();
output.close();
userInput.close();
client.close();
return;
}
System.out.println("Temperature request sent to server...");
System.out.println("Temperature in " + userInput.readLine()+ " is " + serverMsg.readLine());
}

} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

}

}


Temperature server

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.HashMap;
import java.util.StringTokenizer;


public class TemperatureServer implements Runnable {
public static final int PORT = 1234;
HashMap temperatureMap = new HashMap();

public Socket client;

public TemperatureServer() {
try {
ServerSocket theServer = new ServerSocket(PORT);
while (true) {
client = theServer.accept();
new Thread(this).start();
}
} catch (IOException e) {
e.printStackTrace();
}
}

public void getCityTemperatures(){
temperatureMap.put("Melb", new Double(18.9));
temperatureMap.put("Syd", new Double(6.00));
}

public void run() {
BufferedReader input;
PrintWriter output;
String line = new String();

try {
input = new BufferedReader(new InputStreamReader(client
.getInputStream()));
line = input.readLine();
output = new PrintWriter(client.getOutputStream(), true);
while (processMessage(input, output))
;
input.close();
output.close();
} catch (IOException e) {
e.printStackTrace();
}

if(temperatureMap.isEmpty()){
System.out.println("\nCity not on file\n");
return;
}

StringTokenizer cityTemperature = new StringTokenizer(line);
if (cityTemperature.countTokens()!=1) {
System.out.println("\nError encountered :: Not enough information entered\n");
return;
}

String cregisteration = cityTemperature.nextToken();

String key = cityTemperature.nextToken();
temperatureMap.get(key);
}


// private synchronized boolean processMessage(BufferedReader
// input,PrintWriter output) {
private boolean processMessage(BufferedReader input, PrintWriter output) {
try {
String str = input.readLine();
if (str.equalsIgnoreCase("quit"))
return false;
System.out.println("The temperature for the city the user entered is: " + str);

} catch (IOException e) {
e.printStackTrace();
return false;
}
return true;
}

/**
* @param args
*/
public static void main(String[] args) {
new TemperatureServer();
}


}