Can `DataOutputStream` be used to write custom objects directly to a stream?
`DataOutputStream` can write custom objects as long as they are serializable.
You're partially correct. `DataOutputStream` doesn't directly support writing objects, but you can write object data using its methods.
Can you explain why you would still need `ObjectOutputStream` to write a custom object to a stream?