Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB equivalent of Java

Posted on 2013-05-14
3
Medium Priority
?
419 Views
Last Modified: 2013-05-15
What is the VB Equivalent of the following Java code?

	public static final String urlBase = "/bobl/bobl";
	public static final String ENCODING = "ISO-8859-1";
	public static final String DELIMITER = "\r\n";
	protected URL url;
	private InputStream inputStream;
	protected OutputStream outputStream;
	protected Socket socket;
	protected BufferedReader reader;
	private boolean bProcessedHeaders;

Open in new window

0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Expert Comment

by:Ken Butters
ID: 39166163
This is as close as I can get.... I don't believe there is an exact "translation".

Module Module1
    Const urlbase As String = "/bobl/bobl"
    Const ENCODING As String = "ISO-8859-1"
    Const DELIMITER As String = "\r\n"
    Friend URL As Uri
    Friend outputStream As System.IO.StreamWriter
    Friend socket As System.Net.Sockets.Socket
    Friend reader As IO.BufferedStream

    Sub Main()

        Dim inputStream As System.IO.StreamReader
        Dim bProcessedHeaders As Boolean


    End Sub

End Module

Open in new window


Note: I believe the bufferedReader class would need to be instantiated with a StreamReader Class or something similar in order to be used in a similar fashion as a "bufferedReader".
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 39168718
Friend is not the same as protected. It makes the member visible in the project and does not limit it to derived classes. You should use Protected in VB also.

Also, the private variables do not have to be moved inside of a Sub and declared with Dim. Doing so, they will be visile only inside of the Sub. If you want them to be private to the class, you should leave them at the class level and declare them with Private.

	Public Const urlBase As String = "/bobl/bobl"
	Public Const ENCODING As String = "ISO-8859-1"
	Public Const DELIMITER As String = "\r\n"
	Protected url As Uri
	Private inputStream As IO.StreamReader
	Protected outputStream As IO.StreamWriter
	Protected socket As Net.Sockets.Socket
	Protected reader As IO.BufferedStream
	Private bProcessedHeaders As Boolean

Open in new window

0
 

Author Closing Comment

by:lrbrister
ID: 39168952
Perfect.  Thanks
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question