aspose file tools*
The moose likes Beginning Java and the fly likes How send Control Charcter like Control Y in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How send Control Charcter like Control Y in java" Watch "How send Control Charcter like Control Y in java" New topic
Author

How send Control Charcter like Control Y in java

Nisha lakshminaraya
Ranch Hand

Joined: Feb 23, 2010
Posts: 30
Hi,

How do I send "Ctrl+Y" character to output Stream. I want this to be sent programmatically to a device.

Thanks,
Aruna
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1761
    
    7

Are you talking about the ASCII control character "end of medium" i.e 0x19 ?


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Nisha lakshminaraya
Ranch Hand

Joined: Feb 23, 2010
Posts: 30
yes, I think so. What I am trying is to develop is a telnet client which can talk to device.

If I telnet to the device using putty, device prompts me to send "Ctrl + Y " through keyboard. Now, I have written some java code to telnet to device, I am able to connect but it wants me to send "Ctrl + Y" through code and I have no idea how to do it.

How can send "end of Medium" code to outStream ?
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1761
    
    7

Have you tried simply sending a byte representing the appropriate value (0x19)?
Should be easy to test using OutputStream.write(int).
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

You should be able to simply write the byte that represents it - the 0x19 Jelle already mentioned:


Beaten by a full minute


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How send Control Charcter like Control Y in java