• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How send Control Charcter like Control Y in java

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

Thanks,
Aruna
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you talking about the ASCII control character "end of medium" i.e 0x19 ?
 
Nisha lakshminaraya
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried simply sending a byte representing the appropriate value (0x19)?
Should be easy to test using OutputStream.write(int).
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to simply write the byte that represents it - the 0x19 Jelle already mentioned:


Beaten by a full minute
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic