If you are using primitive types you will have toconvert them to an array of bytes then pass this tothe OutputStreams write method.